Skip to content
This repository was archived by the owner on Jun 7, 2024. It is now read-only.

Commit 53d6945

Browse files
committed
fix: socks5
1 parent 86cb5bb commit 53d6945

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var (
2828
cfgfile = flag.String("c", "config.yaml", "config file")
2929
FileLogPath = flag.String("l", "", "log to file")
3030
EnableDebug = flag.Bool("d", false, "Enable debug")
31+
EnableSocks = flag.Bool("s", false, "Enable Socks5")
3132
)
3233

3334
func main() {
@@ -115,7 +116,7 @@ func getSNIServerName(buf []byte) string {
115116

116117
// tls record type
117118
if recordType(buf[0]) != recordTypeHandshake {
118-
serviceDebugger(fmt.Sprintf("Not tls"), 31)
119+
serviceDebugger("Not tls", 31)
119120
return ""
120121
}
121122

@@ -150,8 +151,7 @@ func getSNIServerName(buf []byte) string {
150151
}
151152

152153
func forward(conn net.Conn, data []byte, dst string, raddr string) {
153-
// TODO: FIX
154-
backend, err := GetDialer(true).Dial("tcp", dst)
154+
backend, err := GetDialer(*EnableSocks).Dial("tcp", dst)
155155
if err != nil {
156156
serviceLogger(fmt.Sprintf("Couldn't connect to backend, %v", err), 31)
157157
return

0 commit comments

Comments
 (0)