echotraffic

March 14, 2023 ยท View on GitHub

This small program allows users to view traffic sent by fossa-cli to the FOSSA service.

30 second setup

For more advanced usage, run with the -h flag to see help output.

From source

  1. Install Go: https://go.dev/doc/install
  2. Run go run main.go.
  3. Run fossa analyze -e 'http://localhost:3000' in a different terminal.
  4. Observe fossa-cli traffic written to the terminal.

From prebuilt binary

Go to the latest release and download the appropriate binary for your local system.

How to read output

Each discrete API call is denoted by the line ๐Ÿš€ Forward '{path}' to '{destination}':

โœจ Serving on ':3000', forwarding to 'https://app.fossa.com'
๐Ÿš€ Forward '/api/cli/organization' to 'https://app.fossa.com/api/cli/organization'
GET /api/cli/organization HTTP/1.1
Host: localhost:3000
User-Agent: Go-http-client/1.1
Accept: application/json
Accept-Encoding: gzip
Authorization: Bearer <snip>

If a body is attached to the request, it's listed after a blank line:

๐Ÿš€ Forward '/api/proxy/sherlock/scans/bde59fdc-923b-4429-a871-45fbb24bc2ba/files' to 'https://app.fossa.com/api/proxy/sherlock/scans/bde59fdc-923b-4429-a871-45fbb24bc2ba/files'
POST /api/proxy/sherlock/scans/bde59fdc-923b-4429-a871-45fbb24bc2ba/files HTTP/1.1
Host: localhost:3000
User-Agent: Go-http-client/1.1
Content-Length: 261729
Accept-Encoding: gzip
Authorization: Bearer <snip>
Content-Type: application/json

{"ScanData":{"...