Skip to content

Commit

Permalink
more verbose err output
Browse files Browse the repository at this point in the history
  • Loading branch information
foi committed Apr 22, 2018
1 parent 60d8f14 commit 0fb65f4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
src/
pkg/
releases/
bin/
2 changes: 2 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
1.1.0 - 14.04.2018
* support array of users
* add sysvinit script for centos 6
1.2.0 - 22.04.2018
* more verbose output about errors by genevieve/go-socks5
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ sudo systemctl daemon-reload
sudo systemctl start go-socks5-server
sudo systemctl enable go-socks5-server
# open port in firewall
sudo ufw allow 22
sudo ufw allow 22
sudo ufw allow YOUR_CONFIGURED_GO_SOCKS5_SERVER_PORT
sudo ufw disable && sudo ufw enable
```
Expand Down Expand Up @@ -67,4 +67,8 @@ sudo systemctl enable go-socks5-server
# open port in firewall
```

### How to check go socks5 server

`curl -x socks5://username:password@address:1080 https://web.telegram.org`

### Do not forget to change the config in /etc/go-socks5-server.config.json and restart service
17 changes: 5 additions & 12 deletions go-socks5-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"
"flag"
"github.com/armon/go-socks5"
"github.com/genevieve/go-socks5"
)

const CFG = "/etc/go-socks5-server.config.json"
Expand Down Expand Up @@ -54,21 +54,14 @@ func main() {
}

server, err := socks5.New(conf)

if err != nil {
panic(err)
}

if err := server.ListenAndServe("tcp",
fmt.Sprintf("%s:%s",
configuration.Ip,
configuration.Port)); err != nil {
panic(err)
fmt.Println(fmt.Sprintf("Starting server on: %s:%s",configuration.Ip, configuration.Port));

} else {
fmt.Println(
fmt.Sprintf("go-socks5-server started successfully: ip %s port %s",
configuration.Ip,
configuration.Port))
if err := server.ListenAndServe("tcp", fmt.Sprintf("%s:%s", configuration.Ip, configuration.Port));
err != nil {
panic(err)
}
}

0 comments on commit 0fb65f4

Please sign in to comment.