Detect proxy network
How to detect proxy network in c++ ?
I was asked to use like below.
The above is asking to use system config for connecting to network.
Have many questions. I am using Wifi to connect to network
- How do i detect the selected ssid is proxy network ?
- If selected network is proxy , how do i set username and password ?
i believe the credentials needs to be written to wpa_supplicant file.
If someone can post the piece of code for the requirement, would be helpful
Whether you need to use a proxy server or not has nothing to do with authenticating to a wireless network. It sounds like you are mixing up the two concepts. WPA and SSID's are for connecting to a wireless network, and setting up a QNetworkProxy won't help with that. You must already be joined to the network before you can use that network to connect to a proxy server.
In most cases, you won't need to worry about credentials for connected to the Wifi network. The user will be expected to join it themselves.
How do i detect the selected ssid is proxy network ?
In general, you can't. It's not even a property of the network. You may be able to access internal resources without going through a proxy, but need to connect to a proxy to get to external sites, etc. People may set up PAC, or just require users to enter proxy settings manually. It's pretty much impossible to distinguish between failing to connect to a host because something is broken, and failing to connect to a host because the network administrator wants you to connect to it through some proxy.
If selected network is proxy , how do i set username and password ?
If you are using setUseSystemConfiguration(true), you would just expect the user to configure their machine correctly and put any required credentials in the system's settings.
If you don't want to use the system proxy settings, you would be responsible for how you keep track of proxy credentials, and how you let the user configure your software.