-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
54 lines (42 loc) · 1.34 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
Sultry - TLS Proxy with Multiple Connection Strategies
Architecture Overview:
1. Pure Tunnel Mode (Primary):
Client → Client Proxy → [Direct TCP Connection] → Target Server
2. OOB Handshake Relay (For SNI Concealment):
Client → Client Proxy → [Firewall] → Server Proxy → Target Server
↑ ↓
OOB Channel (SNI hidden)
3. Direct HTTP Fetch:
Client → Client Proxy → [HTTP Request] → Target Server
The proxy system offers multiple strategies with automatic fallback:
- Pure Tunnel Mode provides the highest reliability and compatibility
- OOB Handshake Relay conceals SNI information from network monitors
- Direct HTTP Fetch efficiently handles plain HTTP requests
By implementing these strategies, Sultry balances security, privacy,
and reliability based on the specific requirements of each connection.
*/
package main
import (
"flag"
"log"
)
func main() {
// three modes: client(default)/server/dual
var mode = flag.String("mode", "client", "proxy mode: client/server/dual")
flag.Parse()
// Load configuration
config, err := LoadConfig("config.json")
if err != nil {
log.Fatalf("❌ Failed to load config: %v", err)
}
switch *mode {
case "client":
client(config)
case "server":
server(config)
case "dual":
go client(config)
server(config)
}
}