-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
394 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"name": "trojan_server", | ||
"nodes": [ | ||
{ | ||
"name": "tcp_inbound", | ||
"type": "TcpListener", | ||
"settings": { | ||
"address": "0.0.0.0", | ||
"port": 443, | ||
"nodelay": true | ||
}, | ||
"next": "ssl_server" | ||
}, | ||
{ | ||
"name": "ssl_server", | ||
"type": "OpenSSLServer", | ||
"settings": { | ||
"anti-tls-in-tls": true, | ||
"cert-file": "fullchain.pem", | ||
"key-file": "privkey.pem", | ||
"alpns": [ | ||
{ | ||
"value": "http/1.1", | ||
"next": "node->next" | ||
}, | ||
{ | ||
"value": "h2", | ||
"next": "node->next" | ||
} | ||
], | ||
"fallback": "tls_fallback" | ||
}, | ||
"next": "my-trojan-auth" | ||
}, | ||
{ | ||
"name": "my-trojan-auth", | ||
"type": "TrojanAuthServer", | ||
"settings": { | ||
"fallback": "trojan_fallback", | ||
"fallback-intence-delay": 50, | ||
"users": [ | ||
{ | ||
"name": "sample_user", | ||
"uid": "my_awesome_password", | ||
"enable": true | ||
} | ||
] | ||
}, | ||
"next": "trojan_socks" | ||
}, | ||
{ | ||
"name": "trojan_socks", | ||
"type": "TrojanSocksServer", | ||
"settings": {}, | ||
"next": "users_outbound" | ||
}, | ||
{ | ||
"name": "users_outbound", | ||
"type": "Connector", | ||
"settings": { | ||
"nodelay": true, | ||
"address": "dest_context->address", | ||
"port": "dest_context->port" | ||
} | ||
}, | ||
{ | ||
"name": "tls_fallback", | ||
"type": "TcpConnector", | ||
"settings": { | ||
"nodelay": true, | ||
"address": "demo.nginx.com", | ||
"port": 443 | ||
} | ||
}, | ||
{ | ||
"name": "trojan_fallback", | ||
"type": "TcpConnector", | ||
"settings": { | ||
"nodelay": true, | ||
"address": "httpforever.com", | ||
"port": 80 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "config_tcp_multiport", | ||
"nodes": [ | ||
{ | ||
"name": "input", | ||
"type": "TcpListener", | ||
"settings": { | ||
"address": "0.0.0.0", | ||
"port": [23,65535], | ||
"nodelay": true | ||
}, | ||
"next": "output" | ||
}, | ||
{ | ||
"name": "output", | ||
"type": "TcpConnector", | ||
"settings": { | ||
"nodelay": true, | ||
"address": "1.1.1.1", | ||
"port": "src_context->port" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# MultiPort tcp | ||
|
||
|
||
assumptions: | ||
|
||
> port range: 23 - 65535 | ||
> ip foreign server : 1.1.1.1 | ||
--- | ||
|
||
forward port X to 1.1.1.1:X | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...ples/tunnel/tcp_tunnel/config_client.json → ...irect/tcp/port_to_port/config_client.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"name": "simple_port_to_port", | ||
"name": "config_tcp_port_to_port", | ||
"nodes": [ | ||
{ | ||
"name": "inbound", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# SinglePort Tcp | ||
|
||
|
||
assumptions: | ||
|
||
> port: 443 | ||
> ip foreign server : 1.1.1.1 | ||
--- | ||
|
||
forward port 443 to 1.1.1.1:443 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# MultiPort tls + tcp | ||
|
||
|
||
assumptions: | ||
|
||
> port range: 23 - 65535 | ||
> foreign server address: mydomain.com | ||
> in foreign server, the domain certificate files (fullchain.pem, privkey.pem) are present next to Waterwall | ||
> next protocol is http/1.1 , change it if you need h2 or both | ||
--- | ||
|
||
forward port X to mydomain.com:443 , then tls handshake, then to port X inside the foreign server (mydomain.com) | ||
|
||
preconnect node is added to lower the handshake time | ||
|
||
|
||
config_client.json -> run in local server (iran) | ||
|
||
config_server.json -> run in foreign server (kharej) |
42 changes: 42 additions & 0 deletions
42
examples/tunnel/direct/tls/port_to_port/config_client.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "config_tls_tunnel_client_single_port", | ||
"nodes": [ | ||
{ | ||
"name": "inbound", | ||
"type": "TcpListener", | ||
"settings": { | ||
"address": "0.0.0.0", | ||
"port": 443, | ||
"nodelay": true | ||
}, | ||
"next": "pre_client" | ||
}, | ||
{ | ||
"name": "pre_client", | ||
"type": "PreConnectClient", | ||
"settings": { | ||
"minimum-unused": 8 | ||
}, | ||
"next": "ssl_client" | ||
}, | ||
{ | ||
"name": "ssl_client", | ||
"type": "OpenSSLClient", | ||
"settings": { | ||
"sni": "mydomain.com", | ||
"verify": true, | ||
"alpn": "http/1.1" | ||
}, | ||
"next": "tcp_outbound" | ||
}, | ||
{ | ||
"name": "tcp_outbound", | ||
"type": "TcpConnector", | ||
"settings": { | ||
"nodelay": true, | ||
"address": "mydomain.com", | ||
"port": 443 | ||
} | ||
} | ||
] | ||
} |
43 changes: 43 additions & 0 deletions
43
examples/tunnel/direct/tls/port_to_port/config_server.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "config_tls_tunnel_server_single_port", | ||
"nodes": [ | ||
{ | ||
"name": "inbound", | ||
"type": "TcpListener", | ||
"settings": { | ||
"address": "0.0.0.0", | ||
"port": 443, | ||
"nodelay": true | ||
}, | ||
"next": "ssl_server" | ||
}, | ||
{ | ||
"name": "ssl_server", | ||
"type": "OpenSSLServer", | ||
"settings": { | ||
"cert-file": "fullchain.pem", | ||
"key-file": "privkey.pem", | ||
"alpns": [ | ||
{ | ||
"value": "h2", | ||
"next": "node->next" | ||
}, | ||
{ | ||
"value": "http/1.1", | ||
"next": "node->next" | ||
} | ||
] | ||
}, | ||
"next": "outbound" | ||
}, | ||
{ | ||
"name": "outbound", | ||
"type": "TcpConnector", | ||
"settings": { | ||
"nodelay": true, | ||
"address": "127.0.0.1", | ||
"port": 443 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SinglePort tls + tcp | ||
|
||
|
||
assumptions: | ||
|
||
> port range: 23 - 65535 | ||
> foreign server address: mydomain.com | ||
> in foreign server, the domain certificate files (fullchain.pem, privkey.pem) are present next to Waterwall | ||
> next protocol is http/1.1 , change it if you need h2 or both | ||
--- | ||
|
||
forward port 443 to mydomain.com:443 , then tls handshake, then to port 2083 inside the foreign server (mydomain.com) | ||
|
||
preconnect node is added to lower the handshake time | ||
|
||
|
||
|
||
config_client.json -> run in local server (iran) | ||
|
||
config_server.json -> run in foreign server (kharej) |
48 changes: 48 additions & 0 deletions
48
examples/tunnel/reverse/tcp/port_to_port/config_client.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "config_tcp_reverse_client_port_to_port", | ||
"nodes": [ | ||
{ | ||
"name": "users_inbound", | ||
"type": "TcpListener", | ||
"settings": { | ||
"address": "0.0.0.0", | ||
"port": 443, | ||
"nodelay": true | ||
}, | ||
"next": "bridge2" | ||
}, | ||
{ | ||
"name": "bridge2", | ||
"type": "Bridge", | ||
"settings": { | ||
"pair": "bridge1" | ||
} | ||
}, | ||
{ | ||
"name": "bridge1", | ||
"type": "Bridge", | ||
"settings": { | ||
"pair": "bridge2" | ||
} | ||
}, | ||
{ | ||
"name": "reverse_server", | ||
"type": "ReverseServer", | ||
"settings": {}, | ||
"next": "bridge1" | ||
}, | ||
{ | ||
"name": "foreign_server_inbound", | ||
"type": "TcpListener", | ||
"settings": { | ||
"address": "0.0.0.0", | ||
"port": 443, | ||
"nodelay": true, | ||
"whitelist": [ | ||
"2.2.2.2/32" | ||
] | ||
}, | ||
"next": "reverse_server" | ||
} | ||
] | ||
} |
Oops, something went wrong.