Set up http proxy to solve the problem that the qq music pc version cannot be played
Problem Description
A few days ago, qq music started to have a problem. You can log in, check the daily recommended songs, and read song reviews, but you can’t play songs that require the Internet (prompting that you are connecting to the song or the current network is not good). I consulted qq music The engineer came to the conclusion that the streaming media link of qq music was blocked by the school's network, and qq music couldn't solve it. The recommended solution is to contact the school's network administrator to solve it.
Since the school has blocked the link of QQ music, the only solution is to set up an http proxy as a middleman to bypass the school's blocking. The initial solution was to use a vpn, but qq music blocks foreign ip, so we can only use domestic servers as proxy servers.
I happened to have an Aliyun lightweight server at hand, so I chose to build an http proxy by myself. The system is ubuntu 20.04, and the proxy software installed is Tinyproxy.
Tinyproxy installation and configuration
Connect to Alibaba Cloud with ssl, and enter apt-get install tinyproxy
to install. If the service fails to start after installation and an error is reported tinyproxy.service: Can't open PID file /run/tinyproxy/tinyproxy.pid (yet?) after start: Operation not "permitted"
, please check whether port 8888 of the server is occupied. The default port of Tinyproxy is 8888. If other services occupy this port, an error will be reported.
Enter the command vim /etc/tinyproxy/tinyproxy.conf
to modify the configuration file.
Modify the port : Change 8888 to the port you want, and you don’t need to modify it.
Modify the allowed ip : Change this item to the ip address of your own client, so that only the ip of the client can be connected, but I am a campus network, and the ip will change, so I chose to comment out this item, so that all ip can be used connected.
Hide ip information : I want the proxy to have high anonymity, this option will expose my real ip address, so turn it off
Hide via headers : General headers are added by proxies, forward and reverse proxies, and can appear in request headers and response headers. It is used to track message forwarding, avoid request loops, and identify protocol functions of the sender in the request/response chain. I don't want my real ip address to be added to via and be obtained by qq music. So open this comment
until all modifications to this configuration file are over, enter the command systemctl start tinyproxy
or systemctl restart tinyproxy
start or restart the tinyproxy service.
Enter ufw allow 8887
, open port 8887, and don't forget to open port 8887 in the Alibaba Cloud console.
Finally, use the http proxy in the qq music settings, set the ip address and port, and test that the connection can be normal.