ProxymanApp / ProxymanApp/Proxyman

Mixup of localhost ports between multiple requests

Open
#2,164 14 comments 2 reactions 1 assignee View on GitHub

@NghiaTranUIT is already working on this.

Since Oct 28, 2024.

✅ Done bug
Dominant language
No language data
Stars
7k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

Description

Ports are mixed together if connecting to multiple services using localhost in a Go application.

Steps to Reproduce

We're running an application using multiple forwarded ports due to our services residing inside a VPC using internal load balancers. A part of our configuration used to access these by using port forwarding to an ECS task in our application looks like this:

  • http://localhost:32003 -> Service A
  • http://localhost:32004 -> Service B

Then in our local application we use the following environment configuration:

export SERVICE_A_URL="http://localhost:32003"
export SERVICE_B_URL="http://localhost:32004"

Our application works as intended with this setup, but we cannot inspect the outgoing requests since Proxyman doesn't catch them (at least not on macOS).

This can be solved by adding an entry to /etc/hosts:

127.0.0.1 proxyman.debug

If we then change our URLs in the application environment from localhost to proxyman.debug we can see the requests in Proxyman. Doing this for one service works perfectly:

export SERVICE_A_URL="http://proxyman.debug:32003"
export SERVICE_B_URL="http://localhost:32004"

Current Behavior

When we try to use the proxyman.debug URL for both services like this we run into an issue:

export SERVICE_A_URL="http://proxyman.debug:32003"
export SERVICE_B_URL="http://proxyman.debug:32004"

The service A requests looks correct:

image

But the ports are somehow mixed up for service B requests:

image

We tried adding two different mappings to make Proxyman think these were different endpoints as well:

127.0.0.1 proxyman.first
127.0.0.1 proxyman.second

But this still results in the same issue:

image

Expected Behavior

We expect Proxyman to be able to correctly route these requests to the correct localhost/proxyman.debug port.

Environment

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.