Add v2ray QUIC transport

This commit is contained in:
世界
2022-08-22 21:20:05 +08:00
parent 77c98fd042
commit d4b7e221f0
22 changed files with 336 additions and 25 deletions

View File

@@ -7,6 +7,7 @@ import (
"net"
"net/http"
"net/netip"
"os"
"strings"
"github.com/sagernet/sing-box/adapter"
@@ -125,6 +126,10 @@ func (s *Server) badRequest(request *http.Request, err error) {
s.errorHandler.NewError(request.Context(), E.Cause(err, "process connection from ", request.RemoteAddr))
}
func (s *Server) Network() []string {
return []string{N.NetworkTCP}
}
func (s *Server) Serve(listener net.Listener) error {
if s.httpServer.TLSConfig == nil {
return s.httpServer.Serve(listener)
@@ -133,6 +138,10 @@ func (s *Server) Serve(listener net.Listener) error {
}
}
func (s *Server) ServePacket(listener net.PacketConn) error {
return os.ErrInvalid
}
func (s *Server) Close() error {
return common.Close(s.httpServer)
}