Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for authenticated HTTP proxy in HTTPClient #76442

Open
almusx opened this issue Apr 25, 2023 · 4 comments
Open

Add support for authenticated HTTP proxy in HTTPClient #76442

almusx opened this issue Apr 25, 2023 · 4 comments

Comments

@almusx
Copy link

almusx commented Apr 25, 2023

Godot version

4.0.2

System information

Windows 10, Windows 11

Issue description

Godot has the option to manually add a proxy setting in editor preferences but we need support for authenticated proxy using
username and password. Its Basic proxy authentication TCP 8080 port.
Other softwares load proxy configuration from http_proxy variable and i had my cofiguration like this: http://username:password@proxy.com:8080

Steps to reproduce

Load GODOT, trying to load AssetLib, get error connection to assetlib. No internet connection.
Trying to do a custom android build i get error from gradle downloading...
i tried configuring the proxy in editor preferences like i do in my http_proxy variable: http://username:password@proxy.com:8080 but doesnt work.

Minimal reproduction project

N/A

@Calinou Calinou changed the title Support for Authenticated Proxy Add support for authenticated HTTP proxy in HTTPClient Apr 25, 2023
@Calinou
Copy link
Member

Calinou commented Apr 25, 2023

For reference, HTTP proxy support was added in #55747.

If proxy authentication information is sent as basic HTTP authentication, it should be easy to extract the username and password from the proxy URL and pass it as request headers to the proxy.

@almusx
Copy link
Author

almusx commented Apr 26, 2023

For reference, HTTP proxy support was added in #55747.

If proxy authentication information is sent as basic HTTP authentication, it should be easy to extract the username and password from the proxy URL and pass it as request headers to the proxy.

I know its http proxy using tcp, for the authentication the only information i have is "basic proxy authentication", but I don't know what that means.

@timothyqiu
Copy link
Member

timothyqiu commented Apr 26, 2023

If you want to implement this, all you need is adding an Proxy-Authorization: Basic <Base64 of user:pass> header to the correct request.

  • If the proxy server uses HTTP, add this header to all requests you want to send.

  • If the proxy server uses HTTPS, add this header to the first CONNECT request.

@almusx
Copy link
Author

almusx commented May 1, 2023

A solution for anyone using Godot behind an authenticated proxy, i am using a small program "proxify", its a localhost proxy server that can be configured to connect to the "Real Proxy". You need to configure Godot to connect to proxify : 127.0.0.1:8888 and import TLS certificate generated by proxify, all connection made by Godot are sent to proxify and redirected to your proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants