In addition to the "system proxy" that allows all software to use the proxy together, v2rayN also opens two proxy ports locally. You can Only assign a separate agent to a certain software, other software is not affected. This is especially useful for browsers, Telegram, and command line tools.
1two local ports
After v2rayN is started, it will listen on the local machine:
- SOCKS5 proxy:
127.0.0.1:10808 - HTTP proxy:
127.0.0.1:10809
For any software that supports setting up a proxy, fill in the proxy address as one of the above, and its traffic will go through v2rayN. 127.0.0.1 It's "local", so it's only valid on your computer.
What is the difference between it and "system agent"? The system agent is a one-time agent for the entire system, and all software that recognizes the agent will go together. Manually filling in the port for a single software is "point-to-point" - only this software acts as a proxy, which is more accurate, does not interfere with each other, and does not affect your system settings.
2Set up proxy for browser
- Chrome / Edge: They follow the system proxy by default. If you want to control it alone, it is recommended to install SwitchyOmega Expand, create a new scenario mode, select SOCKS5 for protocol, and select address
127.0.0.1, port10808, switch a certain browser to use the proxy with one click. - Firefox: Firefox has its own independent proxy settings (Settings → Network Settings) and does not need to follow the system. Manually select "Manual proxy configuration" and fill in the SOCKS host
127.0.0.1, port10808, check "Proxy DNS when using SOCKS v5". In this way, Firefox uses the proxy and other browsers are not affected.
3Set up agents for common software
- Telegram desktop version: Settings → Advanced → Connection type → Use custom proxy → SOCKS5, fill in
127.0.0.1:10808. - Git: Command line execution
git config --global http.proxy http://127.0.0.1:10809, to cancelgit config --global --unset http.proxy. - Various development tools (npm, pip, docker, etc.): Most support settings
http_proxy/https_proxyThe environment variables arehttp://127.0.0.1:10809.
The port must be consistent with what v2rayN actually listens to: if you Change the local listening port, the modified port must also be filled in here. The current SOCKS / HTTP port number can be confirmed in the v2rayN parameter settings.
4When to use this method
- I only want a certain browser/software to use the proxy and keep the others directly connected.
- The command line and development tools require an agent, but you don't want to change the system settings (you can also use it directly Tun mode global takeover).
- At the same time, it requires fine control of "part of the software goes through the A node, and part of it is directly connected".