Hello guys. I have a Proxy server inside of my LAN network, And I want to all of my clients on the network, pass through that specific Proxy to access to the Internet, no matter it's smartphone, laptop, PC and etc... just access the WAN by connecting to that Local proxy server.
So what is the best way to do that?
Device: TP-Link TD-W8970 v1
OS: OpenWRT 19.07.3
Proxy type: accepting all protocols(http, htpps, socks v4 and v5 ...) and also authentication is NOT necessary.
As far as OpenWrt is concerned, you can add the option 252 in dhcp options under the interface you want to enable it.
The rest is generic. You can search for examples of wpad.dat and put it on a webserver. If you can convert OpenWrt to serve the wpad.dat from a webserver running on it, you won't need another server.
You first need to configure the PROXY server, and check that it works configuring a client manually.
Now you need an HTTP server, put a "wpad.dat" file there, and again check with a client that it works, configuring it manually as a "setup script" or how it is called in your OS.
Finally, configure the DHCP server on the network router, to announce the configuration script, using option 252.
Tell us how far you got on each step, and we will try to help you.
OK, I guess it's done now. I can access to my wpad.dat using the http://wpad/wpad.dat in my LAN network, and I test my wpad.dat and it works.
But I don't know how to add option 252 to my OpenWRT? which file I must edit and what I expected to insert there?
But I don't see any difference! when a new computer joins the network, It must get this configuration automatically, right? like windows, smartphone and etc...
Currently when I type http://wpad/wpad.dat in my browser, it shows me the contents of wpad file.
If I go to Wi-Fi setting in my IPhone and set the HTTP PROXY to Automatic and leave the URL box, It gets the configuration automatically. But there is three problems:
It's not really an automated job! I still need to make some settings manually for each device.
It's HTTP PROXY, as IPhone called it. Using the web browsers, It's OK,but I have problem with the applications which DoNot supports HTTP Protocol, so they bypass the PROXY and I still have to use 3rd apps to connect to SOCKS 5.
Perhaps I did not understood your message, but for all this to work, all clients must be manually configured to "automatic". The default configuration is not to use any proxy at all, and you cannot change that from the router.
OK, I got it. I expect after doing all of this, I don't need to waste my time for each client and everything done by itself. Rather, I noticed It's useless for IPhone, because it's just apply on HTTP Protocol, which doesn't meet what I want(It not be able to handle my apps). also for android, it doesn't support more than HTTP PROXY by default.
The diffrence between IPhone and Android actually is, in IPhone you can just set HTTP PROXY to auto and leave the URL field(IOS will find it by itself), but in Android you have to go forward and set the exact location to the wpad.dat file. I think I have to install 3rd proxy apps for mobile phone.
Update: In windows, when I get back to LAN settings and check the automatically detect settings, which I was Unchecked this before, the OS now be able to get configuration automatically, also it supports socks 5, so I have no problem with my programs. That's awesome! Thanks to you guys @eduperez@trendy