Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a TCP proxy for debugging. v6.0.117 #3958

Merged
merged 5 commits into from
Mar 19, 2024

Conversation

winlinvip
Copy link
Member

@winlinvip winlinvip commented Feb 21, 2024

When debugging the RTMP protocol, we can capture packets using tcpdump and then replay the pcap file. For example:

cd ~/git/srs/trunk/3rdparty/srs-bench/pcap
tcpdump -i any -w t.pcap tcp port 1935
go run . -f ./t.pcap -s 127.0.0.1:1935

However, sometimes due to poor network conditions between the server and the client, there may be many retransmitted packets. In such cases, setting up a transparent TCP proxy that listens on port 1935 and forwards to port 19350 can be a solution:

./objs/srs -c conf/origin.conf 
cd 3rdparty/srs-bench/tcpproxy/ && go run main.go
tcpdump -i any -w t.pcap tcp port 19350

This approach allows for the implementation of packet dumping, multipoint replication, or the provision of detailed timestamps and byte information at the proxy. It enables the collection of debugging information without the need to modify the server.


TRANS_BY_GPT4


Co-authored-by: john [email protected]

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Feb 21, 2024
@winlinvip winlinvip changed the title Add a TCP proxy for debugging. Add a TCP proxy for debugging. v6.0.117 Mar 19, 2024
@winlinvip winlinvip added the RefinedByAI Refined by AI/GPT. label Mar 19, 2024
@winlinvip winlinvip merged commit ce2ce15 into ossrs:develop Mar 19, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RefinedByAI Refined by AI/GPT. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants