
Hands-on UDP proxies do not roll over
Recently, some IoT project brothers find me to ask the UDP proxy thing, said the live streaming always stuck into the PPT. today we will nag this easily ignored protocol, teach you to do it yourself to build a stable as the old dog's proxy server.
Why do I have to use a UDP proxy?
Engaged in real-time transmission know, TCP that set of confirmation mechanism in the video conference is a drag. Last time for a live platform to do program, they use TCP to pass the screen, the result of the audience to see the mouth can not see the lines. After changing to a UDP proxy.Latency is directly reduced from 300ms to 80msThe effect is immediate.
Fits the scene:
- Game acceleration (especially shooters)
- direct broadcasting push streaming
- IoT Sensor Data Transfer
- VoIP voice calls
Three Minute Quick Configuration Guide
Residential IPs from ipipgo are recommended here, and their UDP support is really well done. Take the Ubuntu system for example:
sudo apt-get install -y tinyproxy sudo nano /etc/tinyproxy/tinyproxy.conf
Find these two lines to configure the change parameters:
Port 8888(Don't use the default port.)
Allow 127.0.0.1(Change to your device IP)
Here's the point! Add this mysterious string of code to the end of the config file:
Protocol udp MaxClients 50 Timeout 600
Remember to restart the service withsystemctl restart tinyproxy, don't be stupid and use the old service command. Use the nc command to send a packet when testing:
echo "test" | nc -u proxy IP 8888
Performance testing measures these points
| test item | passing line | Recommended Tools |
|---|---|---|
| packet loss | <1% | iperf3 |
| delayed swing | <20ms | smokeping |
| maximum concurrency | >50 Connections | wrk |
Last week, the Shanghai node of ipipgo was used to do a stress test, and the stream was pushed for 12 hours straight.zero packet lossIt's much better than a certain one I was using before. They have a unique trick - automatic switching of transit nodes, this can not be seen in the test tool, but it is really stable in practice.
QA session (real user questions)
Q: Will the UDP proxy be speed limited by the carrier?
A: Depends on what type of IP is used. ipipgo's Business Broadband IP is basically not speed-limited, and Home Broadband may be QoS'd.
Q: What if I need both TCP and UDP?
A: Add a Listen 0.0.0.0: TCP port to tinyproxy, but it is recommended to deploy them separately.
Q:Why is the speed measurement normal but the actual use lags?
A: Ninety percent is the MTU setting problem, change the mtu of the network card to 1452 and try the command:
ifconfig eth0 mtu 1452
Guide to avoiding the pit
1. Never open the default port on the cloud server, it will be blown up in minutes.
2. The UDP proxy remembers to match the firewall rules. the command looks like this:
iptables -A INPUT -p udp -dport your port -j ACCEPT
3. When encountering strange packet loss, first change the IP, ipipgo's IP pool has a specially optimized game lines
Lastly, I would like to tell you a lesson in tears: last time, a customer used a free proxy for cheap, and as a result, the sensor data was tampered with by an intermediary, resulting in a direct loss of more than 200,000 dollars. Now they all replaced with ipipgo enterprise version, with data verification UDP protocol is really reliable.

