5 ms·
Sometimes you want to do something that curl cannot express, e.g. timing, protocol oddities, etc. For example you may want to issue a CONNECT to an echo server
by hnav 4mo ago
Sometimes you want to do something that curl cannot express, e.g. timing, protocol oddities, etc. For example you may want to issue a CONNECT to an echo server through a proxy and observe the bytes flowing back and forth. You may want to see what happens when conflicting hop-by-hop headers are specified without worrying about the client's (curl's) interpretation of them. A simple nc -c (or openssl s_client -crlf) lets you do all of that.
- Bender 4mo agoFor what it's worth curl can do very detailed timing [1] and it can also do this using a proxy export http_proxy=http://your.proxy.server:port/ export HTTPS_PROXY=https://your.proxy.server:port/ curl -x http://proxy_server:proxy_port --proxy-user username:password or $socks-wrapper curl # [2] [1] - https://dev.to/gbhorwood/curl-getting-performance-data-with-curl-47f1 https://dev.to/gbhorwood/curl-getting-performance-data-with-... [2] - torsocks, tsocks, wireproxy, shadowsocks-rust, proxychains-ng, etc...
- hnav 4mo agowhat I meant was a proxy that implements HTTP/1.1 CONNECT and a server behind it like ``` mkfifo /tmp/myfifo cat /tmp/myfifo | nc -l 12345 > /tmp/myfifo ``` so if you manually type out CONNECT host:12345 HTTP/1.1 host: host:12345 you can see exactly what's happening. To be fair you can hack curl to support that via curl -x proxy:3333 telnet://host:12345 but that's not exactly what you want and requires curl to have been compiled with telnet support.
- Bender 4mo agoAh, I see what you mean. Aside from putting the proxy into debug logging one would have to use curl -vvv to get similar details but I suppose whatever works best with muscle memory is the right choice and one may not always have access to put the proxy into debug logging. I need to try this with a Squid SSL Bump MitM proxy just dont have one up at the moment. curl -vvv -A Mozilla -H "Accept-Language: en_us" -H "Sec-Fetch-Mode: navigate" --url 'https://nochan.net/.env'