My server, server.example.com, isn't accessible from the Internet. However, there's an accessible HTTP proxy, proxy.example.com, that can talk to the server.
If users configure their browser to go through proxy.example.com for *.example.com, 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.com site, so there doesn't seem to be a security issue which would make this impossible in principle.
My constraint is that proxy.example.com is an HTTP proxy and I cannot touch it. I only control server.example.com and www.example.com, and my web app can only be run on server.example.com.