proxyfor 0.5.0

A powerful and flexible proxy CLI for capturing and inspecting HTTP(S) and WS(S) traffic
Documentation
---
source: tests/web.rs
expression: output
---
/traffic/:id

{
  "gid":<GID>,
  "uri": "http://localhost:<PORT>/echo",
  "method": "POST",
  "req_headers": {
    "items": [
      {
        "name": "content-type",
        "value": "text/plain"
      },
      {
        "name": "accept",
        "value": "*/*"
      },
      {
        "name": "host",
        "value": "localhost:<PORT>"
      },
      {
        "name": "content-length",
        "value": "13"
      }
    ],
    "size": 121
  },
  "req_body_file":"<BODY_FILE>",
  "status": 200,
  "http_version": "HTTP/1.1",
  "res_headers": {
    "items": [
      {
        "name": "content-type",
        "value": "text/plain"
      },
      {
        "name": "content-length",
        "value": "13"
      },
      {
        "name": "date",
        "value": "<DATETIME>"
      }
    ],
    "size": 114
  },
  "res_body_file":"<BODY_FILE>",
  "res_body_size": 13,
  "websocket_id": null,
  "start_time": "<DATETIME>",
  "end_time": "<DATETIME>",
  "error": null,
  "req_body": {
    "encode": "utf8",
    "value": "Hello, World!",
    "size": 13
  },
  "res_body": {
    "encode": "utf8",
    "value": "Hello, World!",
    "size": 13
  }
}

/traffic/:id?markdown


# POST http://localhost:<PORT>/echo 200

REQUEST HEADERS
```
content-type: text/plain
accept: */*
host: localhost:<PORT>
content-length: 13
```

REQUEST BODY
```plain
Hello, World!
```

RESPONSE HEADERS
```
content-type: text/plain
content-length: 13
date: <DATETIME>
```

RESPONSE BODY
```plain
Hello, World!
```

/traffic/:id?har

{
  "log": {
    "version":"<VERSION>",
    "creator": {
      "name": "proxyfor",
      "version":"<VERSION>",
      "comment": ""
    },
    "pages": [],
    "entries": [
      {
        "startedDateTime": "<DATETIME>",
        "time":<TIME>,
        "request": {
          "method": "POST",
          "url": "http://localhost:<PORT>/echo",
          "httpVersion": "HTTP/1.1",
          "cookies": [],
          "headers": [
            {
              "name": "content-type",
              "value": "text/plain"
            },
            {
              "name": "accept",
              "value": "*/*"
            },
            {
              "name": "host",
              "value": "localhost:<PORT>"
            },
            {
              "name": "content-length",
              "value": "13"
            }
          ],
          "queryString": [],
          "postData": {
            "mimeType": "text/plain",
            "text": "Hello, World!"
          },
          "headersSize": 121,
          "bodySize": 13
        },
        "response": {
          "status": 200,
          "statusText": "",
          "httpVersion": "HTTP/1.1",
          "cookies": [],
          "headers": [
            {
              "name": "content-type",
              "value": "text/plain"
            },
            {
              "name": "content-length",
              "value": "13"
            },
            {
              "name": "date",
              "value": "<DATETIME>"
            }
          ],
          "content": {
            "size": 13,
            "mimeType": "text/plain",
            "text": "Hello, World!",
            "compression": 0
          },
          "redirectURL": "",
          "headersSize": 114,
          "bodySize": 13
        },
        "cache": {},
        "timings": {
          "connect": -1,
          "ssl": -1,
          "send": -1,
          "receive": -1,
          "wait": -1
        }
      }
    ]
  }
}

/traffic/:id?curl

curl http://localhost:<PORT>/echo \
  -X POST \
  -H 'content-type: text/plain' \
  -H 'accept: */*' \
  -d 'Hello, World!'