最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Can client JavaScript use its own HTTP proxy? - Stack Overflow

programmeradmin2浏览0评论

My server, server.example, isn't accessible from the Internet. However, there's an accessible HTTP proxy, proxy.example, that can talk to the server.

If users configure their browser to go through proxy.example for *.example, or use a proxy autoconfig file I supply, they can access the server (after authenticating with the proxy). I want to avoid making them go through this manual process.

Is it possible to do this programmatically? The JavaScript will be served from an Internet-accessible www.example site, so there doesn't seem to be a security issue which would make this impossible in principle.

My constraint is that proxy.example is an HTTP proxy and I cannot touch it. I only control server.example and www.example, and my web app can only be run on server.example.

My server, server.example., isn't accessible from the Internet. However, there's an accessible HTTP proxy, proxy.example., that can talk to the server.

If users configure their browser to go through proxy.example. for *.example., or use a proxy autoconfig file I supply, they can access the server (after authenticating with the proxy). I want to avoid making them go through this manual process.

Is it possible to do this programmatically? The JavaScript will be served from an Internet-accessible www.example. site, so there doesn't seem to be a security issue which would make this impossible in principle.

My constraint is that proxy.example. is an HTTP proxy and I cannot touch it. I only control server.example. and www.example., and my web app can only be run on server.example..

Share Improve this question asked Aug 8, 2011 at 20:54 Adam MorrisonAdam Morrison 2063 silver badges8 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

No, but...

This is not possible in the way you asked it. However, the same can be acplished by using an iframe that opens an address of an URL chaining proxy. In your example, you have to call the following address (if your proxy allows URL chaining)

http://proxy.example./http://server.example.

i hope that helps.

cheers, michael

No, you cannot set the proxy by Javascript.

there doesn't seem to be a security issue

Arbitrary Javascript altering browser settings IS a security issue.

发布评论

评论列表(0)

  1. 暂无评论