Unable to install WinInet proxy from WinForms application

I am running windows 7 and IE9. I am writing a winforms application (.net 4.0 and C #) that launches a proxy server (using TcpListener) in another thread.

Before I create the main form, I install the proxy server using InternetSetOption and start the proxy server.

My proxy setup code is very similar to our code: Set proxy username and password using Wininet in C #

then I browse the site in IE, IE does not connect to my proxy server. In addition, IE tools -> Internet settings -> connection -> lan settings -> use a proxy server for your local network. but when I run the script, this checkbox is checked. this means that the violinist sets proxies correctly, but I'm not sure. how does a violinist do it? I went through many blogs, MSDN articles on InternetSetOption in vain. any help is appreciated.

My proxy code is very similar to the code here: Simple Http proxy using Sockets: Questions

I know that my proxy server works because when I go to IE settings β†’ Internet connection settings β†’ connection β†’ lan and explicitly sets the proxy server 127.0.0.1:9898 (where I start my proxy server ), IE and all other browsers connect to my server.

0
source share
1 answer

The WinINET.cs file in this download code: http://code.msdn.microsoft.com/CSWebBrowserWithProxy-c8535715 has the basic functions for setting up the WinINET proxy server. A few small details are a bit wrong, but in most cases they will work fine.

0
source

Source: https://habr.com/ru/post/1717138/


All Articles