[ Cmii ] [ Octopus ] - add all image tag back up; add socks5 proxy
This commit is contained in:
42
socks5_txthinking/old_tcp_tailscale/main.go
Normal file
42
socks5_txthinking/old_tcp_tailscale/main.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Println("start socks5 server error must provide listen port !")
|
||||
return
|
||||
}
|
||||
if len(os.Args) > 3 {
|
||||
fmt.Println("start socks5 server error !")
|
||||
return
|
||||
}
|
||||
username := ""
|
||||
password := ""
|
||||
if len(os.Args) == 4 {
|
||||
username = os.Args[2]
|
||||
password = os.Args[3]
|
||||
}
|
||||
|
||||
port := os.Args[1]
|
||||
|
||||
listener, err := net.Listen("tcp", ":"+port)
|
||||
if err != nil {
|
||||
fmt.Println("start listener error ! => " + err.Error())
|
||||
}
|
||||
|
||||
server := &Server{
|
||||
Username: username,
|
||||
Password: password,
|
||||
}
|
||||
|
||||
err = server.Serve(listener)
|
||||
if err != nil {
|
||||
fmt.Println("server start to server error ! => " + err.Error())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user