justmao945 / mallory

HTTP/HTTPS proxy over SSH
MIT License
319 stars 69 forks source link

how to forward traffic to https sites ? #28

Open changchichung opened 1 year ago

changchichung commented 1 year ago

let's said I want to forward all traffic form localhost:20023 to https://www.google.com.tw I try the command

forward -network tcp -listen :20023 -forward www.google.com.tw:443

but it always get panic

[Downloads ]$ forward -network tcp -listen :20023 -forward www.google.com.tw:443
forward: 2023/03/10 10:45:39 main.go:23: Listening on :20023 for tcp...
forward: 2023/03/10 10:45:49 main.go:35: 0: new 127.0.0.1:35054
forward: 2023/03/10 10:45:49 main.go:38: 0: setup keepalive for TCP connection
forward: 2023/03/10 10:45:49 main.go:50: 0: new 172.217.163.35:443 <-> 127.0.0.1:35054
forward: 2023/03/10 10:45:50 main.go:58: 0: 127.0.0.1:35054 -> 172.217.163.35:443 631 bytes
forward: 2023/03/10 10:45:50 main.go:70: 0: connection closed
forward: 2023/03/10 10:45:50 main.go:64: 0: readfrom tcp 127.0.0.1:20023->127.0.0.1:35054: use of closed network connection
forward: 2023/03/10 10:45:50 main.go:66: 0: 172.217.163.35:443 -> 127.0.0.1:35054 13442 bytes
panic: close of closed channel

any suggestions ??