Skip to content

Conversation

@burmudar
Copy link
Contributor

@burmudar burmudar commented Dec 5, 2025

The customTransport boolean made it a bit awkward to add new things, especially it you want to just wrap a transport. So here we refactor:

  • applyProxy -> NewProxyTransport
  • buildTransport handles all the different configurations to build a transport

Test plan

  • Added minimal unit test

Tested by making Amp write a minimal proxy for unix / http and then running go run ./cmd/src login. For the socks5 proxy I ran ssh -D :5050 media where media is another machine on my network.

  • Integration tests
    • Unix Socket
    • SOCKS5 Proxy
    • HTTP Proxy

@burmudar burmudar self-assigned this Dec 5, 2025
- NewProxyTransport creates a cloned transport which does the required
  proxy handling in dial etc.
- Remove use of 'customTransport'
@burmudar burmudar force-pushed the wb/refactor-apply-proxy branch from 774e849 to fab6e43 Compare December 5, 2025 13:38
@burmudar burmudar requested review from a team and peterguy December 5, 2025 14:09
@burmudar burmudar marked this pull request as ready for review December 5, 2025 14:11
Copy link
Member

@keegancsmith keegancsmith left a comment

Choose a reason for hiding this comment

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

do you have any idea why it took so much care to avoid creating an http.Client? I guess weird code evolution.

Otherwise from what I can tell that is the only functional change this PR does, which is fine. So a refactoring PR right? LGTM

- add doc string
- unexport
- delete low value tests
@burmudar
Copy link
Contributor Author

burmudar commented Dec 8, 2025

do you have any idea why it took so much care to avoid creating an http.Client? I guess weird code evolution.

Otherwise from what I can tell that is the only functional change this PR does, which is fine. So a refactoring PR right? LGTM

No idea tbh. I think it was just being a tad overcautious?

@burmudar burmudar enabled auto-merge (squash) December 8, 2025 09:32
@burmudar burmudar merged commit 36a33de into main Dec 8, 2025
8 checks passed
@burmudar burmudar deleted the wb/refactor-apply-proxy branch December 8, 2025 09:35
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.

3 participants