If you're using wireguard please refer to v2ray+wireguard to bypass GFW and netflix/spotify/hulu
Two things need to be paid
- vps(such as bandwagonhost)
- If you are using China Telecom, a CN2 network is required, or you may get stuck when streaming video
- For bandwagonhost, you need to login, click Client Area -> Services -> Order New Services to get CN2 server
- vpn vendor to unblock netflix(a openvpn connection that can unblock netflix)
The basic idea is setup a socks5 proxy to forawrd all network traffic from the socks5 to a specific openvpn, in v2ray, forward all the netflix traffic to the socks5 proxy
The openvpn connection is highly unstable or slow due to GFW
You can easily get a fast VPS(CN2) from various provider, but most of them can't combined the fast and stable connection from China && unblock from the netflix
So, I decide to do it myself
-
install v2ray
bash <(curl -s -L https://git.io/v2ray.sh)
-
config openvpn connection inside a docker container
In most case the following command can't set up properly, please read the Notice part to change the configuration if there's something wrong
git clone https://github.com/zpoint/openvpn_socks5_docker.git
cd openvpn_socks5_docker
./build.sh
./start.sh
launch *.ovpn
-
exit the docker container, change your v2ray configure file to forward the netflix traffic to the openvpn connection inside the container, this is part of my configure file located in
/etc/v2ray/config.json
"inbounds": [ { "port": 8888, "protocol": "vmess", "settings": { "clients": [ { // private config } ] }, "streamSettings": { "network": "ws" }, "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] } } ] "outbounds": [ { "protocol": "socks", "settings": { "servers": [{ "port": 9050, "address": "localhost" }] }, "streamSettings": { "tcpSettings": { "header": { "type": "none" } }, "network": "tcp", "security": "none" }, "tag": "streaming" } ] "routing": { "domainStrategy": "IPOnDemand", "rules": [ { "type": "field", "domain": [ "domain:btstatic.com", "domain:netflix.com", "domain:netflix.net", "domain:nflxext.com", "domain:nflximg.com", "domain:nflximg.net", "domain:nflxsearch.net", "domain:nflxso.net", "domain:nflxvideo.net", "domain:ipaddress.com" ], "outboundTag": "streaming" } ] }
I seem to having an issue with the v2ray outbound to socks connection on server side
The OpenVPN socks docker container works fine when I try connecting directly thru curl
e.g.
curl --socks5 [::1]:9050 <domain>
curl --socks5 localhost:9050 <domain>
orcurl --socks5 127.0.0.1:9050 <domain>
all return 200 OK, and it is indeed using the IP of the openvpn server
However when I try to connect through v2ray it doesn't work and I get a bunch of these in the v2ray error logs:
Checking the danted logs in the docker container, I see:
for every single domain I try to connect to. But this doesn't happen when I directly do
curl --socks5
e.g. doing curl to ipinfo.io via socks5
So it seems to be something do to with DNS, but I'm not clear at which level
Here is my v2ray conf
I have tried with and without routing in config
Any ideas? :)