Skip to content

Commit 7ee5db0

Browse files
updated README 3
1 parent 81b556b commit 7ee5db0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ Options:
130130
-v print version
131131
```
132132

133-
## Example
134-
135133
### Configuration via CLI flags
136134

137135
```shell
@@ -236,13 +234,13 @@ This functionality available only on Linux systems and requires additional setup
236234

237235
`-T address` flag specifies the address of transparent proxy server (`GoHPTS` will be running without HTTP server).
238236

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).
240238

241239
In other words, `-T` spins up a single server, but `-t` two servers, `http` and `tcp`.
242240

243241
There are two modes `redirect` and `tproxy` that can be specified with `-M` flag
244242

245-
## `redirect` (Transparent proxy via NAT)
243+
## `redirect` (via _NAT_ and _SO_ORIGINAL_DST_)
246244

247245
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)`
248246

@@ -309,7 +307,7 @@ iptables -t nat -F GOHPTS
309307
iptables -t nat -X GOHPTS
310308
```
311309

312-
## `tproxy` (Transparent proxy with IP_TRANSPARENT socket option)
310+
## `tproxy` (via _MANGLE_ and _IP_TRANSPARENT_)
313311

314312
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.
315313

@@ -333,7 +331,7 @@ gohpts -s 1080 -T 0.0.0.0:1090 -M tproxy -d
333331
ssh remote -D 1080 -Nf
334332
```
335333

336-
Setup your operating system:
334+
**Setup your operating system:**
337335

338336
```shell
339337
ip netns exec ns-client ip route add default via 10.0.0.1

0 commit comments

Comments
 (0)