Intro
Previously, to access campus resources anytime and anywhere, I wrote Seamless Access to Campus Resources with Surge + Snell v5 + frp.
Later, when I needed to access lab resources from anywhere, I replicated the same approach on the lab-assigned work computer. But it didn't last long—my work computer's network access was blocked after just 2 days. IT said this approach was unacceptable; I explained that the lab doesn't grant VPN access to students, so I had to solve it myself. Two days later, IT told me they'd decided to grant me VPN access.
Although VPN connections have many drawbacks, as I mentioned in the previous post, there was no other option.
Problem Solved
Yesterday I received the VPN connection details along with the username and password. As expected, it was Sangfor.
While researching solutions earlier, I came across this docker-easyconnect, which runs a Sangfor VPN inside Docker and exposes SOCKS5 and HTTP proxy services, allowing other applications to route their traffic through these ports.
So I came up with a plan:
- Use docker-easyconnect to connect to the VPN and provide SOCKS5 and HTTP proxies
- Use Surge for traffic routing
So far, the experience with this setup is essentially the same as the one described in Seamless Access to Campus Resources with Surge + Snell v5 + frp:
- Not all traffic goes through the VPN indiscriminately
- No need to frequently toggle the VPN on and off
It even has some advantages:
- No need for a computer/server on the campus network running 24/7
No need for a server with a public IP and stable connection for intranet penetration
Most importantly: it doesn't violate any lab rules
The setup is extremely simple—basically a one-liner—so I'll skip the details.
The Surge routing part was already covered in the previous post, so I won't repeat it here.
Tail
The solution mentioned in this post is also applicable to school VPNs in general.
Since I haven't used it for very long, I don't yet know what issues might arise—I suspect keep-alive could be one.
If you're facing similar challenges, you might want to give this approach a try.