Skip to content

Instantly share code, notes, and snippets.

@georgyo
Created January 6, 2024 15:07
Show Gist options
  • Save georgyo/4aae7cec3005c62f17b4e8018f8e35ed to your computer and use it in GitHub Desktop.
Save georgyo/4aae7cec3005c62f17b4e8018f8e35ed to your computer and use it in GitHub Desktop.
cohtp proxy http request
% http_proxy=http://127.0.0.1:30000 https_proxy=http://127.0.0.1:30000 all_proxy=http://127.0.0.1:30000 curl --http1.1 -vvv http://ifconfig.io/ua
Warning: Overrides previous HTTP version option
* Uses proxy env variable http_proxy == 'http://127.0.0.1:30000'
* Trying 127.0.0.1:30000...
* Connected to 127.0.0.1 (127.0.0.1) port 30000
> GET http://ifconfig.io/ua HTTP/1.1
> Host: ifconfig.io
> User-Agent: curl/8.4.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
< Date: Sat, 06 Jan 2024 15:06:50 GMT
< Content-Type: text/plain; charset=utf-8
< CF-Cache-Status: DYNAMIC
< Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=u4hxN9bbnGJ%2FVHC%2BBdnH01xVF4UidYa0XtRn2MlSIwowkBF9siJGyF7rAx0xoU9U6jg1gYYuc%2FwP2%2B2cKQv%2BGMGCSzFi%2FKTwb6d6Za8pKMmEVmnV%2FSI3QWQUW1jDjg%3D%3D"}],"group":"cf-nel","max_age":604800}
< NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< Server: cloudflare
< CF-RAY: 8414de03de6b42c6-EWR
< alt-svc: h3=":443"; ma=86400
< transfer-encoding: chunked
<
curl/8.4.0
* Connection #0 to host 127.0.0.1 left intact
% dune exec cohttp-lwt-unix/bin/cohttp_proxy_lwt.exe -- -s 127.0.0.1 -p 30000 --verbose
Listening for HTTP request on: 127.0.0.1 30000
--> GET http://ifconfig.io/ua ((headers
((Host ifconfig.io) (User-Agent curl/8.4.0) (Accept */*)
(Proxy-Connection Keep-Alive)))
(meth GET) (scheme ()) (resource http://ifconfig.io/ua) (version HTTP_1_1)
(encoding Unknown))
[INFO][application]: GET http://ifconfig.io/ua
<-- http://ifconfig.io/ua ((encoding (Fixed 11))
(headers
((Date "Sat, 06 Jan 2024 15:06:50 GMT")
(Content-Type "text/plain; charset=utf-8") (Content-Length 11)
(Connection keep-alive) (CF-Cache-Status DYNAMIC)
(Report-To
"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=u4hxN9bbnGJ%2FVHC%2BBdnH01xVF4UidYa0XtRn2MlSIwowkBF9siJGyF7rAx0xoU9U6jg1gYYuc%2FwP2%2B2cKQv%2BGMGCSzFi%2FKTwb6d6Za8pKMmEVmnV%2FSI3QWQUW1jDjg%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}")
(NEL
"{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}")
(Server cloudflare) (CF-RAY 8414de03de6b42c6-EWR)
(alt-svc "h3=\":443\"; ma=86400")))
(version HTTP_1_1) (status OK) (flush false))
Connection (TCP ((fd <opaque>) (ip 127.0.0.1) (port 27580))) closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment