base sagernet and migrate to circleci

This commit is contained in:
iceBear67
2026-07-16 04:47:12 +00:00
parent cf2658264a
commit 87871e223f
16 changed files with 322 additions and 149 deletions
@@ -163,8 +163,8 @@
+ )
+}
+
+// NewConnectionEx receives TCP connections from the listener and feeds them to the HTTP server.
+func (h *Inbound) NewConnectionEx(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc) {
+// NewConnection receives TCP connections from the listener and feeds them to the HTTP server.
+func (h *Inbound) NewConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc) {
+ if h.tlsConfig != nil {
+ tlsConn, err := boxTLS.ServerHandshake(ctx, conn, h.tlsConfig)
+ if err != nil {
@@ -444,7 +444,7 @@
+ return hex.EncodeToString(b)
+}
+
+// connListener bridges the listener.Listener (which pushes connections via NewConnectionEx)
+// connListener bridges the listener.Listener (which pushes connections via NewConnection)
+// with http.Server.Serve() (which expects a net.Listener).
+type connListener struct {
+ ch chan net.Conn