mirror of
https://github.com/apernet/hysteria.git
synced 2025-04-07 06:27:39 +03:00
feat: server SOCKS5 outbound
This commit is contained in:
parent
6b880ba22d
commit
97ef033b65
6 changed files with 309 additions and 130 deletions
|
@ -144,6 +144,17 @@ func server(config *serverConfig) {
|
|||
if config.IPv6Only {
|
||||
transport.DefaultServerTransport.IPv6Only = true
|
||||
}
|
||||
// SOCKS5 outbound
|
||||
if config.SOCKS5Outbound.Server != "" {
|
||||
ob, err := transport.NewSOCKS5Client(config.SOCKS5Outbound.Server,
|
||||
config.SOCKS5Outbound.User, config.SOCKS5Outbound.Password, 10*time.Second)
|
||||
if err != nil {
|
||||
logrus.WithFields(logrus.Fields{
|
||||
"error": err,
|
||||
}).Fatal("Failed to initialize SOCKS5 outbound")
|
||||
}
|
||||
transport.DefaultServerTransport.SOCKS5Client = ob
|
||||
}
|
||||
// ACL
|
||||
var aclEngine *acl.Engine
|
||||
if len(config.ACL) > 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue