Fix advanced ping endpoint and clarify packet crafting behavior #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Traffic page ping functionality was failing because the frontend sends multi-protocol requests (ICMP/TCP/UDP/HTTP/DNS) but the backend only accepted a simple hostname parameter. Additionally, users reported SYN packets to 8.8.8.8 not receiving responses, which is expected behavior for filtered ports.
Changes
Backend API (
traffic.py)PingRequestmodel to accept protocol-specific parameters:target,protocol,port,count,timeout,packet_size,use_httpsPacket Crafting (
SnifferService.py)Example
Response now includes detailed statistics:
{ "protocol": "tcp", "target": "8.8.8.8", "port": 53, "successful": 4, "packet_loss": 0, "min_ms": 12.3, "avg_ms": 15.7, "max_ms": 18.2, "results": [...] }Notes
SYN packets to public DNS servers (8.8.8.8) not responding to non-DNS ports is correct firewall behavior. The UI now displays explanatory notes to avoid confusion.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.