Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefanoj3/tordock
Dockerized TOR socks5
https://github.com/stefanoj3/tordock
Last synced: about 2 months ago
JSON representation
Dockerized TOR socks5
- Host: GitHub
- URL: https://github.com/stefanoj3/tordock
- Owner: stefanoj3
- Created: 2018-07-13T20:34:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-15T09:50:27.000Z (over 6 years ago)
- Last Synced: 2024-08-03T17:12:20.553Z (5 months ago)
- Homepage: https://hub.docker.com/r/stefanoj3/tordock
- Size: 1.95 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-network-stuff - **6**星
README
## tordock
Containerized Tor SOCKS5.
#### How to
Check your current ip:
```
curl icanhazip.com
```Start the container:
```
docker run -d -p 127.0.0.1:9150:9150 stefanoj3/tordock:latest
```Http call using the just spawned tor socks5, you should get a different ip:
```
curl --socks5-hostname 127.0.0.1:9150 icanhazip.com
```#### How can I use it from my favourite language?
Here is an example with golang:
```go
package mainimport (
"fmt"
"io/ioutil"
"net/http"
"net/url""golang.org/x/net/proxy"
)func main() {
tbProxyURL, err := url.Parse("socks5://127.0.0.1:9150")
if err != nil {
panic(err)
}tbDialer, err := proxy.FromURL(tbProxyURL, proxy.Direct)
if err != nil {
panic(err)
}tbTransport := &http.Transport{Dial: tbDialer.Dial}
client := &http.Client{Transport: tbTransport}resp, err := client.Get("http://icanhazip.com")
if err != nil {
panic(err)
}
defer resp.Body.Close()fmt.Printf("GET returned: %v\n", resp.Status)
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}fmt.Println(string(body))
}
```