-
Notifications
You must be signed in to change notification settings - Fork 2
/
naivesocks-example.tml
134 lines (109 loc) · 3.2 KB
/
naivesocks-example.tml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# NaiveSocks configration file example
#
# Using (modified) TOML:
# https://github.com/toml-lang/toml
# https://github.com/hex11/Nett
#
# How NaiveSocks works:
#
# [client] ==> [InAdapter] ==(Controller)==> [OutAdapter] ==> [destination]
#
# 1) InAdapter accepts incomming connection (which should indicate a destination).
# 2) The connection is dispatched to OutAdapter.
# 3) OutAdapter connects to the destination.
# 4) Start relaying between the incomming connection and the destination.
##### BEGIN of local configration example #####
# This is an InAdapter:
[in.socks5listener]
# ^^^^^^^^^^^^^^ InAdapter name, which is up to you
type = 'socks'
# Available InAdapter types: direct, socks, http, naive, ss, tproxy (Linux only)
listen = '127.0.0.1:1080'
# Listening endpoint
out = 'examplenaivec'
# Name of OutAdapter that handles incomming connections from this adapter.
# This is an OutAdapter:
[out.examplenaive]
# ^^^^^^^^^^^^ OutAdapter name
type = 'naive'
# ^^^^^ Naive Multiplexing protocol over Websocket
# Available OutAdapter types: direct, socks, http, ss, naive, router
uri = 'ws://example.com/'
# A URI specifying Naive server address, port and path
# 'wss://example.com/' indicates using TLS and default port 443
key = 'this is the key'
# Encryption key
## (Optionals & defaults):
# imux = 1
# connect_on_start = false
# pool_min_free = 2
# pool_concurrency = 32
# connect_delay = 1
# connect_delay_multiplier = 2
# connect_delay_max = 36
# fastopen = true
##### END of local configration example #####
##### BEGIN of server configration example #####
[in.naive_listener]
type = 'naive'
listen = '0.0.0.0:80'
key = 'this is the key'
out = 'direct'
## (Optionals & defaults):
# path = '/'
## No need to declare these adapters because they exist by default...
# [out.direct]
# type = 'direct'
# force_dest = '...unless you need this...'
#
# [out.fail]
# type = 'fail'
# reason = '...or this.'
##### END of server configration example #####
# [in.whatever]
# type = 'ss'
# listen = '0.0.0.0:1079'
# key = 'this is the key'
# encryption = 'aes-128-ctr'
# out = 'examplenaivec'
# [in.direct]
# type = 'direct'
# listen = '0.0.0.0:1078'
# dest = 'example.com:80'
# out = { type = 'direct', name = 'direct_inline' }
## You can use inline table to declare adapters, name is optional.
# [out.direct]
# type = 'direct'
## (Optionals):
# force_dest = 'example.com:80'
[out.socks5out]
type = 'socks5'
server = '127.0.0.1:1080'
## (Optionals):
# username = 'abc'
# password = '123'
## 'router' is a type of OutAdatper that handles connections by rules.
# [out.rt]
# type = 'router'
# default = 'direct'
## Redirect a connection to this adapter if it isn't matched by any rule
# rules = [{
# abp = 'ABP FILTER STRING'
# abpfile = 'ABP FILTER FILE PATH'
# abpuri = 'ABP FILTER URI'
# base64 = false # true if abp content is base64 encoded
# eq = 'google.com'
# wildcard = '*.google.*'
# regex = '^(www|play)\.google\.com$'
# port = 80
#
# # If ANY one above is matched:
# new_host = 'new_dest_host_here' # supports regex group: $0, $1, $2...
# new_dest = 'new_dest:port_here' # also supports regex group
# to = 'adapter_name_or_inline_table_here'
#
# # Every fields (even 'to') are optional
# },
# {
# # Next rule here...
# }]