2
2
3
3
a simple load balanced torsocks service, a fork of the excellent [ Iglesys347/castor] ( https://github.com/Iglesys347/castor )
4
4
5
- creates a defined number of backend tor circuits, leveraging haproxy to round-robin requests
5
+ creates an infinite number of backend tor circuits, leveraging haproxy to round-robin requests
6
6
7
- tl;dr - one ingress proxy, infinite exit circuits
7
+ multisocks will expose a SOCKS5 proxy on ` :8080 ` and a statistics report on haproxy at ` :1337 `
8
8
9
9
``` mermaid
10
- graph TD
11
- A[client] -->|socks5:// *:8080| B(haproxy)
12
- B --> D[tor relay 1]
13
- B --> E[tor relay 2]
14
- B --> F[tor relay 3]
10
+ flowchart TB
11
+ sclient[proxy client :8080]-->front
12
+ stat{{stats :1337}}-->front
13
+ front[haproxy]
14
+ style sclient fill:#f9f,stroke:#333,stroke-width:2px
15
+ style stat fill:#bbf,stroke:#f66,stroke-width:2px,color:#fff,stroke-dasharray: 5 5
16
+ subgraph scaler[x scaled instances]
17
+ subgraph tor1 [tor]
18
+ ctrl[controlport]
19
+ sock[socksport]
20
+ end
21
+ subgraph tor2 [tor]
22
+ ctrl2[controlport]
23
+ sock2[socksport]
24
+ end
25
+ subgraph tor3 [tor]
26
+ ctrl3[controlport]
27
+ sock3[socksport]
28
+ end
29
+ end
30
+ front<-->sock
31
+ front-. healthcheck .-> ctrl
32
+ front<-->sock2
33
+ front-. healthcheck .-> ctrl2
34
+ front<-->sock3
35
+ front-. healthcheck .-> ctrl3
15
36
```
16
37
17
38
---
@@ -20,23 +41,25 @@ graph TD
20
41
21
42
set the number of tor instances to be created by altering ` SOCKS ` within ` .env `
22
43
23
- alternativley see ` services.tor.deploy.replicas ` within ` docker-compose.yml `
44
+ _ reference ` services.tor.deploy.replicas ` within ` docker-compose.yml ` _
24
45
## runtime
25
46
26
47
``` shell
27
48
git clone https://github.com/joshhighet/multisocks
28
49
docker compose --file multisocks/docker-compose.yml up --detach
29
50
```
30
51
52
+ after bringing up the containerset - you will need to wait for tor to build circuits before the proxy will accept connections
53
+
54
+ to view the status of haproxy, navigate to ` your-multisocks-host:1337 ` in a browser
55
+
31
56
## debugging
32
57
33
58
``` shell
34
59
cd multisocks
35
60
docker compose logs --timestamps --follow
36
61
```
37
62
38
- _ for further tracing, modify ` Log ` within ` tor/torrc ` or enable the ` ControlPort ` and leverage [ nyx] ( https://nyx.torproject.org ) _
39
-
40
63
## testing
41
64
42
65
``` shell
0 commit comments