Skip to content

Add ProxyConnectionSettings to all connection types #221

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

michel-laterman
Copy link
Contributor

@michel-laterman michel-laterman commented May 6, 2025

@michel-laterman michel-laterman requested a review from a team as a code owner May 6, 2025 22:00
@michel-laterman michel-laterman force-pushed the feat/proxy-connection-settings branch from f76d025 to 203dded Compare May 6, 2025 22:23
@michel-laterman michel-laterman requested a review from andykellr May 8, 2025 17:11
string url = 1;

// Optional headers to send to proxies during CONNECT requests.
// These headers can be ignored for non-HTTP based proxies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a non-HTTP based proxy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOCKS

@@ -432,6 +444,18 @@ message TLSConnectionSettings {
repeated string cipher_suites = 6;
}

// Status: [Development]
message ProxyConnectionSettings {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this only apply to plain http transport or also to WebSocket? I do not know how proxies work for WebSocket connections.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gorilla/websocket is lacking support for connection headers, but the URL will apply.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a PR to add this, hopefully it can be review soon: gorilla/websocket#988

##### ProxyConnectionSettings.connect_headers

Option headers the Client should set for HTTP based proxies initial CONNECT
request. Other proxy types, such as SOCKS5 may ignore these headers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the type of the proxy specified? Does the Client need to know the type of the proxy?

Copy link
Contributor Author

@michel-laterman michel-laterman May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think due to how websockets behaves our proxy settings will differ for websocket/http servers.
There's currently an open issue: http://github.com/gorilla/websocket/issues/479 to allow connection headers with websockets.

EDIT: To answer your question; the schema in the URL should indicate the type i.e., http, sock5.
HTTP proxies should use the headers, but as stated above there is an issue that effects opamp-go implementation when using an http proxy with a websocket connection

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My demo now sets proxy connect headers: open-telemetry/opamp-go#389

@tigrannajaryan
Copy link
Member

Sorry for the delay, I had the comments in Pending state, forgot to publish them 🤦

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

Successfully merging this pull request may close these issues.

Proxy & TLS settings in OpAMPConnectionSettings, TelemetryConnectionSettings, and OtherConnectionSettings
3 participants