|  | @@ -13,7 +13,7 @@ import (
 | 
											
												
													
														|  |  	v2net "github.com/v2ray/v2ray-core/common/net"
 |  |  	v2net "github.com/v2ray/v2ray-core/common/net"
 | 
											
												
													
														|  |  	"github.com/v2ray/v2ray-core/common/retry"
 |  |  	"github.com/v2ray/v2ray-core/common/retry"
 | 
											
												
													
														|  |  	proxyerrors "github.com/v2ray/v2ray-core/proxy/common/errors"
 |  |  	proxyerrors "github.com/v2ray/v2ray-core/proxy/common/errors"
 | 
											
												
													
														|  | -	jsonconfig "github.com/v2ray/v2ray-core/proxy/socks/config/json"
 |  | 
 | 
											
												
													
														|  | 
 |  | +	"github.com/v2ray/v2ray-core/proxy/socks/config"
 | 
											
												
													
														|  |  	"github.com/v2ray/v2ray-core/proxy/socks/protocol"
 |  |  	"github.com/v2ray/v2ray-core/proxy/socks/protocol"
 | 
											
												
													
														|  |  )
 |  |  )
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -26,10 +26,10 @@ var (
 | 
											
												
													
														|  |  type SocksServer struct {
 |  |  type SocksServer struct {
 | 
											
												
													
														|  |  	accepting  bool
 |  |  	accepting  bool
 | 
											
												
													
														|  |  	dispatcher app.PacketDispatcher
 |  |  	dispatcher app.PacketDispatcher
 | 
											
												
													
														|  | -	config     *jsonconfig.SocksConfig
 |  | 
 | 
											
												
													
														|  | 
 |  | +	config     config.SocksConfig
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -func NewSocksServer(dispatcher app.PacketDispatcher, config *jsonconfig.SocksConfig) *SocksServer {
 |  | 
 | 
											
												
													
														|  | 
 |  | +func NewSocksServer(dispatcher app.PacketDispatcher, config config.SocksConfig) *SocksServer {
 | 
											
												
													
														|  |  	return &SocksServer{
 |  |  	return &SocksServer{
 | 
											
												
													
														|  |  		dispatcher: dispatcher,
 |  |  		dispatcher: dispatcher,
 | 
											
												
													
														|  |  		config:     config,
 |  |  		config:     config,
 | 
											
										
											
												
													
														|  | @@ -48,7 +48,7 @@ func (this *SocksServer) Listen(port v2net.Port) error {
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	this.accepting = true
 |  |  	this.accepting = true
 | 
											
												
													
														|  |  	go this.AcceptConnections(listener)
 |  |  	go this.AcceptConnections(listener)
 | 
											
												
													
														|  | -	if this.config.UDPEnabled {
 |  | 
 | 
											
												
													
														|  | 
 |  | +	if this.config.UDPEnabled() {
 | 
											
												
													
														|  |  		this.ListenUDP(port)
 |  |  		this.ListenUDP(port)
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  	return nil
 |  |  	return nil
 | 
											
										
											
												
													
														|  | @@ -138,7 +138,7 @@ func (this *SocksServer) handleSocks5(reader *v2net.TimeOutReader, writer io.Wri
 | 
											
												
													
														|  |  		return err
 |  |  		return err
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -	if request.Command == protocol.CmdUdpAssociate && this.config.UDPEnabled {
 |  | 
 | 
											
												
													
														|  | 
 |  | +	if request.Command == protocol.CmdUdpAssociate && this.config.UDPEnabled() {
 | 
											
												
													
														|  |  		return this.handleUDP(reader, writer)
 |  |  		return this.handleUDP(reader, writer)
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  |  
 |  |  
 |