Making an XMLHttpRequest through a proxy?

白昼怎懂夜的黑 提交于 2021-01-28 07:53:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!