Skip to content

Conversation

evgeniy-scherbina
Copy link
Contributor

No description provided.

@evgeniy-scherbina evgeniy-scherbina force-pushed the yevhenii/proxy-v2 branch 2 times, most recently from 4a5fa1e to 741503e Compare October 13, 2025 22:14
@evgeniy-scherbina evgeniy-scherbina changed the base branch from yevhenii/remove_cap_dac_override to main October 14, 2025 16:29
@evgeniy-scherbina evgeniy-scherbina marked this pull request as ready for review October 14, 2025 19:40
Copy link

@cstyan cstyan left a comment

Choose a reason for hiding this comment

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

It's hard to review this much more without more context, I've not been involved in boundary so far and there's PR description to indicate the goal here. I only have the brief 60s description from Garrett of the issues you all were seeing in boundary to go off of.

That said, the code here looks fine, I just have two main comments:

  • I would remove all usage of emoji in the code, for logging and otherwise
  • I would use the buffered reader Peak as opposed to this new connectionWrapper type to deal with needing to peak at the first byte of the connection bytes to know if we're using TLS

p.logger.Error("Error copying response body", "error", copyErr, "bytes_written", bytesWritten)
http.Error(w, "Failed to copy response", http.StatusBadGateway)
if isTLS {
p.logger.Debug("🔒 Detected TLS connection - handling as HTTPS")
Copy link

Choose a reason for hiding this comment

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

nit: I think we should avoid usage of emoji in logging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do in a follow-up PR

`,
r.Method, r.URL.Path, host, host, r.Method, host, r.Method)
}
connWrapper := &connectionWrapper{conn, buf, false}
Copy link

Choose a reason for hiding this comment

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

imo using buffered reader peak would be nicer than this connectionWrapper type: https://pkg.go.dev/bufio#Reader

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'll take a look into that. I kept this part from proxy-v1 implementation.
Proxy-v1 had many bugs, but connectionWrapper worked fine.

@evgeniy-scherbina evgeniy-scherbina merged commit 7d83c3e into main Oct 18, 2025
3 checks passed
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.

2 participants