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
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,8 +130,6 @@ Options:
130
130
-v print version
131
131
```
132
132
133
-
## Example
134
-
135
133
### Configuration via CLI flags
136
134
137
135
```shell
@@ -236,13 +234,13 @@ This functionality available only on Linux systems and requires additional setup
236
234
237
235
`-T address`flag specifies the address of transparent proxy server (`GoHPTS` will be running without HTTP server).
238
236
239
-
`-t address`flag specifies the address of transparent proxy server (other functionality stays the same).
237
+
`-t address`flag specifies the address of transparent proxy server (`HTTP` proxy and other functionality stays the same).
240
238
241
239
In other words, `-T` spins up a single server, but `-t` two servers, `http` and `tcp`.
242
240
243
241
There are two modes `redirect` and `tproxy` that can be specified with `-M` flag
244
242
245
-
## `redirect` (Transparent proxy via NAT)
243
+
## `redirect` (via _NAT_ and _SO_ORIGINAL_DST_)
246
244
247
245
In this mode proxying happens with `iptables` `nat` table and `REDIRECT` target. Host of incoming packet changes to the address of running `redirect` transparent proxy, but it also contains original destination that can be retrieved with `getsockopt(SO_ORIGINAL_DST)`
248
246
@@ -309,7 +307,7 @@ iptables -t nat -F GOHPTS
309
307
iptables -t nat -X GOHPTS
310
308
```
311
309
312
-
## `tproxy` (Transparent proxy with IP_TRANSPARENT socket option)
310
+
## `tproxy` (via _MANGLE_ and _IP_TRANSPARENT_)
313
311
314
312
In this mode proxying happens with `iptables``mangle` table and `TPROXY` target. Transparent proxy sees destination address as is, it is not being rewrited by the kernel. For this to work the proxy binds with socket option `IP_TRANSPARENT`, `iptables` intercepts traffic using TPROXY target, routing rules tell marked packets to go to the local proxy without changing their original destination.
0 commit comments