Hello everyone,
Context:
Teleworking without VPN
WAPT version: 2.2 Enterprise
Server OS: Debian 11
Administration console OS: Win10pro
Package development workstation OS: Win10pro
Hello,
We have a package development machine that needs to go through an outgoing proxy.
Proxy settings are configured globally (Internet settings) as well as in the agent and local console settings:
`http_proxy = ...`
`use_http_proxy_for_server=1` `
use_http_proxy_for_repo=1`
The console accesses the server and repository correctly.
Internet browsing goes through the proxy correctly.
However, when we run the `update_package` function, which calls the `waptguihelper.login_password_dialog` function (API access) from PyScripter, and then attacks the API via `wgets`, the connection tries to establish itself directly without going through the outgoing proxy. See the output of `netstat -an`:
TCP INTERNAL_IP_DEV_STATION:55484 EXTERNAL_IP_WAPT_SERVER:443 SYN_SENT
How can I force PyScripter to use a proxy (I haven't seen any corresponding settings)?
Sincerely,
Christophe.
[SOLVED] Pyscripter and proxy settings
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
-
croquebert
- Messages: 33
- Registration: March 30, 2022 - 5:41 PM
Good morning,croquebert wrote: ↑March 22, 2023 - 5:38 PM Hello everyone,
Context:
Teleworking without VPN
WAPT version: 2.2 Enterprise
Server OS: Debian 11
Administration console OS: Win10pro
Package development workstation OS: Win10pro
Hello,
We have a package development machine that needs to go through an outgoing proxy.
Proxy settings are configured globally (Internet settings) as well as in the agent and local console settings:
http_proxy = ...
use_http_proxy_for_server=1
use_http_proxy_for_repo=1
The console accesses the server and repository correctly.
Internet browsing goes through the proxy correctly.
However, when we run the update_package function, which calls the waptguihelper.login_password_dialog function (API access) from PyScripter, and then attacks the API via wgets, the connection tries to establish itself directly without going through the outgoing proxy. See the output of netstat -an:
TCP INTERNAL_IP_DEV_STATION:55484 EXTERNAL_IP_WAPT_SERVER:443 SYN_SENT
How can I force PyScripter to use a proxy (I haven't seen any corresponding settings)?
Christophe.
After reading the wgets documentation, using the proxies parameter partially solved the problem.
Pyscripter does not take global proxy settings into account, despite the initialization of these proxy settings at the internet settings level, via netsh or environment variable.
This can be problematic because there may be multiple package developers on different sites using different (and changing) proxies.
Is there a way to force Pyscripter to take global proxy settings into account so that I don't have to specify the proxy settings in the called functions?
Sincerely.
- sfonteneau
- WAPT Expert
- Messages: 2318
- Registered: July 10, 2014 - 11:52 PM
- Contact :
Good morning
Note that the update packages are not linked to pyscripter or any other IDE.
Python executes the code (and you can even launch the update package from the console).
That's why we generally have the following at the beginning of update packages:
And that we then use the proxies variable in the rest of the script
`get_proxies()` retrieves the machine's proxies
get_proxies_from_wapt_console() retrieves the proxies from the console.
Note that the update packages are not linked to pyscripter or any other IDE.
Python executes the code (and you can even launch the update package from the console).
That's why we generally have the following at the beginning of update packages:
Code: Select all
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
`get_proxies()` retrieves the machine's proxies
get_proxies_from_wapt_console() retrieves the proxies from the console.
-
croquebert
- Messages: 33
- Registration: March 30, 2022 - 5:41 PM
Good morning,sfonteneau wrote: ↑March 24, 2023 - 10:29 Good morning
Note that the update packages are not linked to pyscripter or any other IDE.
Python executes the code (and you can even launch the update package from the console).
That's why we generally have the following at the beginning of update packages:
And that we then use the proxies variable in the rest of the scriptCode: Select all
proxies = get_proxies() if not proxies: proxies = get_proxies_from_wapt_console()
`get_proxies()` retrieves the machine's proxies
get_proxies_from_wapt_console() retrieves the proxies from the console.
Thank you for the feedback.
I can indeed modify the packet code to take proxy settings into account where necessary.
I wanted to avoid this, but the global proxy settings (environment variables, netsh, etc.) don't seem to be recognized by the Python interpreter. I need to investigate further...
