Skip to content

feat: add tcp stream reassembly, interactive selection, and pyproject.toml#17

Open
adrianlzt wants to merge 3 commits into
jullrich:mainfrom
adrianlzt:main
Open

feat: add tcp stream reassembly, interactive selection, and pyproject.toml#17
adrianlzt wants to merge 3 commits into
jullrich:mainfrom
adrianlzt:main

Conversation

@adrianlzt

@adrianlzt adrianlzt commented Mar 11, 2026

Copy link
Copy Markdown

Summary

  • Add TCP stream reassembly to handle HTTP requests spanning multiple packets
  • Add interactive connection selection menu with TLS detection
  • Migrate from setup.py to pyproject.toml
  • Update README with usage instructions

Changes

TCP Stream Reassembly

  • Group packets by TCP connection (4-tuple)
  • Reassemble stream data ordered by TCP sequence numbers
  • Extract request bodies using Content-Length header
  • Handle multiple requests per connection (keep-alive/pipelining)

Interactive Selection

  • Remove -p/--port argument; auto-detect HTTP on any port
  • Display all HTTP connections with request summaries
  • Allow user to select multiple connections for curl output
  • Detect and mark TLS/encrypted connections as non-selectable

Build System

  • Replace setup.py with pyproject.toml using hatchling backend
  • Add uv.lock for dependency locking
  • Bump version to 0.2

Example

❯ uvx --from git+https://github.com/adrianlzt/pcap2curl pcap2curl capture.pcap
Found 6 HTTP connection(s):

[1] 127.0.0.1:58524 → 127.0.0.1:8000 (2 request(s))
    POST /api/v1/auth/refresh
    GET /api/v1/db-changes/stream

[2] 127.0.0.1:45692 → 127.0.0.1:2024 (1 request(s))
    POST /threads

Select connections (comma-separated, e.g., 1,3): 1,2

# Connection 1: 127.0.0.1:58524 → 127.0.0.1:8000

curl 'http://127.0.0.1:8000/api/v1/auth/refresh' \
 -X POST \
 -H 'Content-Type: application/json' \
 -d '{"refresh_token":"..."}'

Coded using an LLM.

Refactor to properly handle HTTP requests spanning multiple TCP packets.
Instead of processing each packet individually, the tool now reassembles
TCP streams and extracts complete HTTP requests with their bodies.

Changes:
- Remove -p/--port argument; auto-detect HTTP on any port
- Group packets by TCP connection (4-tuple)
- Reassemble stream data ordered by TCP sequence numbers
- Extract request bodies using Content-Length header
- Add interactive menu to select connections for curl output
- Detect and mark TLS/encrypted connections as non-selectable
- Handle multiple requests per connection (keep-alive/pipelining)
- Add *.pcap to gitignore
Replace legacy setup.py with modern pyproject.toml configuration.
Bump version to 0.2 to reflect the new TCP stream reassembly feature.

Changes:
- Add pyproject.toml with hatchling build backend
- Remove setup.py
- Add uv.lock for dependency locking
- Update README to reflect TCP stream reassembly support
Add installation instructions using uvx and a complete example showing
the interactive connection selection workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant