Skip to content

How to implement proxy authentication? #613

@stargazer33

Description

@stargazer33

How do I specify the user name and password to use for proxy authentication?

This proxy supports:

curl -x "https://proxy-user:proxy-password@proxy-host:proxy-port" "https://example.com/..."

curl -x "http://proxy-user:proxy-password@proxy-host:proxy-port" "https://example.com/..."

curl -U "proxy-user:proxy-password" -x "proxy-host:proxy-port" "https://example.com/..."

curl -x "socks5h://proxy-user:proxy-password@proxy-host:proxy-port" "https://example.com/..."

It seems, something like this does not works:

        Proxy proxy = new Proxy(
            Proxy.Type.HTTP,
            new InetSocketAddress(
                "http://proxy-user:proxy-password@proxy-host", proxy-port
            )
        );
        
         OpenAIOkHttpClient.builder()
         .proxy( proxy )

There is no place for proxy-user + proxy-password in java.net.Proxy

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions