You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-77Lines changed: 43 additions & 77 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Daze is a software that helps you pass through firewalls, in other words, a proxy. It uses a simple yet efficient protocol, ensuring that you never get detected or blocked.
4
4
5
-
#Getting Started
5
+
## Introduction
6
6
7
7
Daze is designed as a single-file application. First, compile or [download](https://github.com/mohanson/daze/releases) daze:
8
8
@@ -16,7 +16,7 @@ $ cmd/develop.sh
16
16
$ cmd/develop.ps1
17
17
```
18
18
19
-
The build results will be saved in the bin directory. You can keep this directory, and all other files are not required.
19
+
The build results will be saved in the `bin` directory. You can keep this directory, and all other files are not required.
# Use the following command to link your server(replace $SERVER with your server IP):
30
30
$ daze client -s $SERVER:1081 -k $PASSWORD
31
31
# Now, you are free to visit the Internet
32
-
$ curl -x socks5://127.0.0.1:1080 google.com
33
-
```
34
-
35
-
Daze is still under development. You should make sure that the server and client have the same version number (check with the `daze ver` command) or commit hash.
36
-
37
-
# Using Daze for Different Platforms
38
-
39
-
Daze is implemented in pure Go language, so it can run on almost any operating system. The following are some of the browsers/operating systems commonly used by me:
40
-
41
-
## Android
42
-
43
-
0. Cross-compile daze for Android: `GOOS=android GOARCH=arm64 go build -o daze github.com/mohanson/daze/cmd/daze`
44
-
0. Push the compiled file to the phone. You can use [adb](https://developer.android.com/studio/command-line/adb) or create an HTTP server and download daze with `wget` in [termux](https://play.google.com/store/apps/details?id=com.termux&hl=en).
45
-
0. Run `daze client -l 127.0.0.1:1080 ...` in the termux.
46
-
0. Set the proxy for phone: WLAN -> Settings -> Proxy -> Fill in `127.0.0.1:1080`
47
-
48
-
## Chrome
49
-
50
-
Chrome does not support setting proxies, so a third-party plugin must be used. [Proxy SwitchyOmega](https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif?hl=en) works very well.
51
-
52
-
## Firefox
53
-
54
-
Firefox can configure a proxy in `Connection Settings` -> `Manual proxy configuration` -> `SOCKSv5 Host=127.0.0.1` and `Port=1080`. If you see an option `Use remote DNS` on the page, check it.
- Destination: The destination is an internet service provider, for example, google.com.
69
-
- Daze Server: A daze server is an instance that runs using the command `daze server`.
70
-
- Firewall: A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on pre-determined security rules.
71
-
- Daze Client: A daze client is an instance that runs using the command `daze client`.
72
-
- User: A user is a browser or any other application attempting to access the destination.
73
-
- Middle Protocol: The middle protocol is the communication protocol between the daze server and daze client. Data is encrypted and obfuscated to bypass firewalls.
74
-
- Client Protocol: The client protocol is the communication protocol between the daze client and the user.
75
-
76
-
# Protocols
77
-
78
-
## Client Protocols
79
-
80
-
The daze client implements 6 different proxy protocols in one port. These protocols are http proxy, https tunnel, socks4, socks4a, socks5 and socks5h.
Why can one port support so many protocols? Because it's magic!
40
+
Daze is still under development. You should make sure that the server and client have the same version number (check with the `daze ver` command) or commit hash.
41
+
42
+
## Deployment
43
+
44
+
Daze is implemented in pure Go language, so it can run on almost any operating system. The following are some of the browsers/operating systems commonly used by me:
98
45
99
-
## Middle Protocols
46
+
0. Android. Cross-compile daze for android: `GOOS=android GOARCH=arm64 go build -o daze github.com/mohanson/daze/cmd/daze`. Push the compiled file to the phone, You can use [adb](https://developer.android.com/studio/command-line/adb) or create an http server and download daze with `wget` in [termux](https://play.google.com/store/apps/details?id=com.termux&hl=en). Run `daze client -l 127.0.0.1:1080 ...` in the termux. Set the proxy for phone: WLAN -> Settings -> Proxy -> Fill in `127.0.0.1:1080`
47
+
0. Chrome. Chrome does not support setting proxies, so a third-party plugin must be used. [Proxy SwitchyOmega](https://chrome.google.com/webstore/detail/proxy-switchyomega/padekgcemlokbadohgkifijomclgjgif?hl=en) works very well.
48
+
0. Firefox can configure a proxy in `Connection Settings` -> `Manual proxy configuration` -> `SOCKSv5 Host=127.0.0.1` and `Port=1080`. If you see an option `Use remote DNS` on the page, check it.
100
49
101
-
Daze currently has 4 middle protocols.
50
+
## Configuration: Protocols
102
51
103
-
### Ashe
52
+
Daze currently has 4 protocols.
53
+
54
+
**Ashe**
104
55
105
56
The default protocol used by daze is called ashe. Ashe is a TCP-based cryptographic proxy protocol designed to bypass firewalls while providing a good user experience.
106
57
107
-
Please note that **it is the user's responsibility to ensure that the date and time on both the server and client are consistent**. The ashe protocol allows for a deviation of up to two minutes.
58
+
Please note that it is the user's responsibility to ensure that the date and time on both the server and client are consistent. The ashe protocol allows for a deviation of up to two minutes.
108
59
109
-
### Baboon
60
+
**Baboon**
110
61
111
62
Protocol baboon is a variant of the ashe protocol that operates over HTTP. In this protocol, the daze server masquerades as an HTTP service and requires the user to provide the correct password in order to gain access to the proxy service. If the password is not provided, the daze server will behave as a normal HTTP service. To use the baboon protocol, you must specify the protocol name and a fake site:
Protocol czar is an implementation of the ashe protocol based on TCP multiplexing. Multiplexing involves reusing a single TCP connection for multiple ashe protocols, which saves time on the TCP three-way handshake. However, this may result in a slight decrease in data transfer rate (approximately 0.19%). In most cases, using Protocol czar provides a better user experience compared to using the ashe protocol directly.
121
72
@@ -124,7 +75,7 @@ $ daze server ... -p czar
124
75
$ daze client ... -p czar
125
76
```
126
77
127
-
### Dahlia
78
+
**Dahlia**
128
79
129
80
Dahlia is a protocol used for encrypted port forwarding. Unlike many common port forwarding tools, it requires both a server and a client to be configured. Communication between the server and client is encrypted in order to bypass detection by firewalls.
Reminder again: Dahlia is not a proxy protocol but a port forwarding protocol.
138
89
139
-
# Proxy Control
90
+
## Configuration: Proxy Control
140
91
141
92
Proxy control is a rule that determines whether network requests (TCP and UDP) go directly to the destination or are forwarded to the daze server. Use the `-f` option in the daze client to adjust the proxy configuration.
142
93
143
94
- Use local network for all requests.
144
95
- Use remote server for all requests.
145
-
- Use both local and remote server (default).
96
+
- Use both local and remote server (default). In this case, the following two configuration files are enabled:
146
97
147
-
## File rule.ls
98
+
**rule.ls**
148
99
149
-
Daze uses a "rule.ls" file to customize your own rules(optional). "rule.ls" has the highest priority in routers so you should carefully maintain it. The "rule.ls" is located on the "rule.ls" by default, or you can use `daze client -r path/to/rule.ls` to apply it.
100
+
Daze uses a "rule.ls" file to customize your own rules. File "rule.ls" has the highest priority in routers so you should carefully maintain it. The "rule.ls" is located on the "rule.ls" by default, or you can use `daze client -r path/to/rule.ls` to apply it. Its syntax is very simple:
150
101
151
102
```text
152
103
L a.com
153
104
R b.com
154
105
B c.com
155
106
```
156
107
157
-
- L(ocale) means using local network
158
-
- R(emote) means using proxy
159
-
- B(anned) means to block it, often used to block ads
108
+
- L(ocale) means using local network.
109
+
- R(emote) means using proxy.
110
+
- B(anned) means to block it, often used to block ads.
160
111
161
112
Glob is supported, such as `R *.google.com`.
162
113
163
-
## File rule.cidr
114
+
**rule.cidr**
164
115
165
116
Daze also uses a CIDR(Classless Inter-Domain Routing) file to route addresses. The CIDR file is located at "rule.cidr", and has a lower priority than "rule.ls".
166
117
167
118
By default, daze has configured rule.cidr for China's mainland. You can update it manually via `daze gen cn`, this will pull the latest data from [http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest](http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest).
168
119
169
-
#DNS resolver
120
+
## Configuration: DNS
170
121
171
122
The DNS server and DNS protocol used by daze can be specified through command line parameters.
172
123
173
124
-`DNS: daze ... -dns 1.1.1.1:53`
174
125
-`DoT: daze ... -dns 1.1.1.1:853`
175
126
-`DoH: daze ... -dns https://1.1.1.1/dns-query`
176
127
177
-
This [article](https://www.cloudflare.com/learning/dns/dns-over-tls/) briefly describes the difference between them. I know many people don't like to read articles, so I just suggest that add `-dns 1.1.1.1:853` in daze.
128
+
This [article](https://www.cloudflare.com/learning/dns/dns-over-tls/) briefly describes the difference between them.
129
+
130
+
## Configuration: Bandwidth Limiter
131
+
132
+
You can limit the maximum bandwidth used by daze. Generally speaking, for daze server, it is recommended to set the bandwidth to a value slightly smaller than the physical bandwidth.
133
+
134
+
```sh
135
+
# For daze server, set -b 320k if your physical bandwidth is 3M, where 320 = 3 * 1024 / 8 - 64.
136
+
$ daze server ... -b 320k
137
+
# For daze client, in most cases no configuration is necessary.
0 commit comments