txthinking / brook

A cross-platform programmable network tool
https://brook.app
GNU General Public License v3.0
14.5k stars 2.39k forks source link

[Enhancement]: custom header with websocket protocol #1362

Open Soneoylys opened 1 month ago

Soneoylys commented 1 month ago

for bypassing local ISP throttling, need custom headers configuration like "Host"

txthinking commented 1 month ago

supported. If your wsserver is ws://1.2.3.4:9999 and want to set host to example.com:80, then yo can get brook link: brook link -s ws://example.com:80 --address 1.2.3.4:9999

Soneoylys commented 1 month ago

tried on freebsd (aarch64) with v20240606, cannot get it link reproduce: passing ddns domain into --address, not work

tried modify /etc/hosts with cron + script, work as expected tried on third party clients (shadowrocket), work as expected

for android/ios official clients, i cannot figure how to pass full configuration in maybe i'm dumb, the command i've trying are:

./brook_freebsd_arm64 wsclient --http="127.0.0.1:38080" --socks5="127.0.0.1:30080" --password="DUMMY@0" --wsserver="ws://dummy.dummy.net:10000/ws" --address="ddns.dummy.net:10000"

./brook_freebsd_arm64 link --address="ddns.dummy.net:10000" --password="DUMMY@0" --server="dummy.dummy.net:10000/ws" --udpovertcp

txthinking commented 3 weeks ago

CLI client will try to resolve ddns.dummy.net:10000 to ip:port for each connection, but GUI client only resolve ddns.dummy.net:10000 to ip:port once and use it on the runtime.