通过代理进行XMLHttpRequest吗? [英] Making an XMLHttpRequest through a proxy?

查看:64
本文介绍了通过代理进行XMLHttpRequest吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用JavaScript以编程方式从浏览器通过代理服务器路由HTTP请求?

Is it possible to route HTTP requests through a proxy server programmatically from the browser with JavaScript?

推荐答案

假设您的意思是标准的HTTP代理:否.代理服务器的使用是浏览器配置设置,无法从JS更改(或什至暂时覆盖).

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.

您可以向服务器上的常规HTTP端点发出HTTP请求,该请求通过向其他服务器发出HTTP请求来确定应做出的响应.

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.

这篇关于通过代理进行XMLHttpRequest吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆