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.
When debugging the RTMP protocol, we can capture packets using tcpdump and then replay the pcap file. For example:
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:
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 hondaxiao@tencent.com