mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-28 13:05:28 -05:00
remove use of context.WithValue in transport
This commit is contained in:
@@ -22,10 +22,10 @@ type Server struct {
|
||||
}
|
||||
|
||||
func (server *Server) Start() (net.Destination, error) {
|
||||
return server.StartContext(context.Background())
|
||||
return server.StartContext(context.Background(), nil)
|
||||
}
|
||||
|
||||
func (server *Server) StartContext(ctx context.Context) (net.Destination, error) {
|
||||
func (server *Server) StartContext(ctx context.Context, sockopt *internet.SocketConfig) (net.Destination, error) {
|
||||
listenerAddr := server.Listen
|
||||
if listenerAddr == nil {
|
||||
listenerAddr = net.LocalHostIP
|
||||
@@ -33,7 +33,7 @@ func (server *Server) StartContext(ctx context.Context) (net.Destination, error)
|
||||
listener, err := internet.ListenSystem(ctx, &net.TCPAddr{
|
||||
IP: listenerAddr.IP(),
|
||||
Port: int(server.Port),
|
||||
})
|
||||
}, sockopt)
|
||||
if err != nil {
|
||||
return net.Destination{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user