问题
Is it possible to route HTTP requests through a proxy server programmatically from the browser with JavaScript?
回答1:
Assuming you mean a standard HTTP proxy: No. The use of a proxy server is a browser configuration setting and cannot be changed (or even temporarily overridden) from JS.
You could make an HTTP request to a regular HTTP endpoint on a server that determines the response it should make by making an HTTP request to a different server.
回答2:
You can use some browser-extensions like "Bettenet VPN Proxy" or "Bear VPN" for this (Chrome).
来源:https://stackoverflow.com/questions/43895039/making-an-xmlhttprequest-through-a-proxy