ducaale / xh

Friendly and fast tool for sending HTTP requests
MIT License
5.49k stars 96 forks source link

display remote address in metadata #348

Closed zuisong closed 8 months ago

zuisong commented 8 months ago

implement proposal #347

example output

❯ cargo run -- httpbin.org/get -vv
   Compiling xh v0.20.1 (/Users/chen/mydata/xh)
    Finished dev [unoptimized + debuginfo] target(s) in 2.20s
     Running `/Users/chen/.rust-target/debug/xh httpbin.org/get -vv`
GET /get HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Host: httpbin.org
User-Agent: xh/0.20.1

HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 295
Content-Type: application/json
Date: Wed, 17 Jan 2024 04:45:33 GMT
Server: gunicorn/19.9.0

{
    "args": {},
    "headers": {
        "Accept": "*/*",
        "Accept-Encoding": "gzip, deflate, br",
        "Host": "httpbin.org",
        "User-Agent": "xh/0.20.1",
        "X-Amzn-Trace-Id": "Root=1-65a75b6d-787ccc48646e40ce75195807"
    },
    "origin": "47.242.3.58",
    "url": "http://httpbin.org/get"
}

Elapsed time: 0.67198s
Remote address: 3.224.157.95:80