mirror of
https://github.com/Alexey71/opera-proxy.git
synced 2026-05-15 07:01:00 +00:00
add socks mode
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/Snawoot/opera-proxy/dialer"
|
||||
"github.com/armon/go-socks5"
|
||||
"log"
|
||||
)
|
||||
|
||||
func NewSocksServer(dialer dialer.ContextDialer, logger *log.Logger) (*socks5.Server, error) {
|
||||
return socks5.New(&socks5.Config{
|
||||
Rules: &socks5.PermitCommand{
|
||||
EnableConnect: true,
|
||||
},
|
||||
Logger: logger,
|
||||
Dial: dialer.DialContext,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user