[GH-ISSUE #119] duplicated connection working in an office #71

Open
opened 2026-03-03 19:11:32 +03:00 by kerem · 12 comments
Owner

Originally created by @chrisknapp98 on GitHub (Nov 15, 2022).
Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/119

Originally assigned to: @NghiaTranUIT on GitHub.

hi, me and my colleagues are experiencing duplicated connections from atlantis to Proxyman when we are working at the office. Thus, we receive the same network request multiple times with the exact same time, duration etc.

I couldn't find the root of the issue, but filtering in NetServiceTransport#connectToService(_ service: NetService) also gets the job done. Maybe it could be a change to be considered for a future release. Let's see if I manage to create a PR

A problem could be that with that change devices which have the same name couldn't connect both over the network to atlantis

Originally created by @chrisknapp98 on GitHub (Nov 15, 2022). Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/119 Originally assigned to: @NghiaTranUIT on GitHub. hi, me and my colleagues are experiencing duplicated connections from atlantis to Proxyman when we are working at the office. Thus, we receive the same network request multiple times with the exact same time, duration etc. I couldn't find the root of the issue, but filtering in NetServiceTransport#connectToService(_ service: NetService) also gets the job done. Maybe it could be a change to be considered for a future release. Let's see if I manage to create a PR A problem could be that with that change devices which have the same name couldn't connect both over the network to atlantis
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 15, 2022):

Do you specify the Computer Name when starting the Atlantis Service?

By doing it, Atlantis only connects to this computer, not your colleague's computers.

You can find a name in the Atlantis Windows.

Screenshot_2022-11-15_at_16_39_46

<!-- gh-comment-id:1315047351 --> @NghiaTranUIT commented on GitHub (Nov 15, 2022): Do you specify the Computer Name when starting the Atlantis Service? By doing it, Atlantis only connects to this computer, not your colleague's computers. You can find a name in the Atlantis Windows. ![Screenshot_2022-11-15_at_16_39_46](https://user-images.githubusercontent.com/5878421/201885430-f858083c-663a-43d3-9e2a-7c92484489c9.jpg)
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 15, 2022):

and what Atlantis library version you're using 🤔 ?

<!-- gh-comment-id:1315048038 --> @NghiaTranUIT commented on GitHub (Nov 15, 2022): and what Atlantis library version you're using 🤔 ?
Author
Owner

@chrisknapp98 commented on GitHub (Nov 15, 2022):

version 1.19.0

<!-- gh-comment-id:1315053786 --> @chrisknapp98 commented on GitHub (Nov 15, 2022): version 1.19.0
Author
Owner

@chrisknapp98 commented on GitHub (Nov 15, 2022):

The issue is not that it connects to my colleagues computers. No matter if I specify the device in start call, atlantis still keeps connecting multiple times to my Proxyman client. Sometimes it doesn't but often the conection is there like 5 times

<!-- gh-comment-id:1315055461 --> @chrisknapp98 commented on GitHub (Nov 15, 2022): The issue is not that it connects to my colleagues computers. No matter if I specify the device in start call, atlantis still keeps connecting multiple times to my Proxyman client. Sometimes it doesn't but often the conection is there like 5 times
Author
Owner

@chrisknapp98 commented on GitHub (Nov 15, 2022):

Okay I haven't got any permissions to push a new branch. But my fix is in line 226 after the guard let hostName to add

        guard !connections.contains(where: { connection in
            if case let NWEndpoint.service(name: connectedHostName, type: _, domain: _, interface: _) = connection.endpoint {
                let splittedHostName = hostName.split(separator: ".")
                let deviceName = splittedHostName.indices.contains(0) ? splittedHostName[0].lowercased() : "DEVICE_NAME"
                if connectedHostName.contains(deviceName) {
                    print("[Atlantis] Found duplicated endpoint")
                }
                return connectedHostName.contains(deviceName)
            }
            return false
        }) else {
            print("[Atlantis] Aborting new connection")
            return
        }
<!-- gh-comment-id:1315058128 --> @chrisknapp98 commented on GitHub (Nov 15, 2022): Okay I haven't got any permissions to push a new branch. But my fix is in line 226 after the guard let hostName to add ``` guard !connections.contains(where: { connection in if case let NWEndpoint.service(name: connectedHostName, type: _, domain: _, interface: _) = connection.endpoint { let splittedHostName = hostName.split(separator: ".") let deviceName = splittedHostName.indices.contains(0) ? splittedHostName[0].lowercased() : "DEVICE_NAME" if connectedHostName.contains(deviceName) { print("[Atlantis] Found duplicated endpoint") } return connectedHostName.contains(deviceName) } return false }) else { print("[Atlantis] Aborting new connection") return } ```
Author
Owner

@chrisknapp98 commented on GitHub (Nov 15, 2022):

ohh I'm just noticing that splitting at a dot and taking index 0 only works with our devices because the host name of our devices always is the serial number with the .local suffix

<!-- gh-comment-id:1315381647 --> @chrisknapp98 commented on GitHub (Nov 15, 2022): ohh I'm just noticing that splitting at a dot and taking index 0 only works with our devices because the host name of our devices always is the serial number with the .local suffix
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 15, 2022):

If you don't mind, please add a checkpoint to this line github.com/ProxymanApp/atlantis@a761f2c8a2/Sources/Transporter.swift (L229)

and see how many print output.

If it connect to the same Macbook multiple times, we can see multiple outputs.

<!-- gh-comment-id:1315420487 --> @NghiaTranUIT commented on GitHub (Nov 15, 2022): If you don't mind, please add a checkpoint to this line https://github.com/ProxymanApp/atlantis/blob/a761f2c8a2880b38ff5701e8c0b4e8dacd35c22e/Sources/Transporter.swift#L229 and see how many print output. If it connect to the same Macbook multiple times, we can see multiple outputs.
Author
Owner

@chrisknapp98 commented on GitHub (Nov 15, 2022):

exactly! That's how I knew atlantis connected to the same device multiple times. Without the guard block I added, this print with the exact same hostName can be seen multiple times.
I think this also especially happens when there are like 3+ colleagues in the office which are running Proxyman on their mac

<!-- gh-comment-id:1315437299 --> @chrisknapp98 commented on GitHub (Nov 15, 2022): exactly! That's how I knew atlantis connected to the same device multiple times. Without the guard block I added, this print with the exact same hostName can be seen multiple times. I think this also especially happens when there are like 3+ colleagues in the office which are running Proxyman on their mac
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 15, 2022):

@chrisknapp98 can you try this branch https://github.com/ProxymanApp/atlantis/pull/120?

I refactor a little bit and prevent connecting multiple times to a single Host. I suppose that it can fix the bug.

How to install

Cocoapod

pod 'atlantis-proxyman', :git => 'https://github.com/ProxymanApp/atlantis.git', :commit => '7ee8312b13a6b872a0068bdf11bfc66511614c9f'

SPM

  • Checkout this commit: 7ee8312b13a6b872a0068bdf11bfc66511614c9f
<!-- gh-comment-id:1315467468 --> @NghiaTranUIT commented on GitHub (Nov 15, 2022): @chrisknapp98 can you try this branch https://github.com/ProxymanApp/atlantis/pull/120? I refactor a little bit and prevent connecting multiple times to a single Host. I suppose that it can fix the bug. ### How to install #### Cocoapod ``` pod 'atlantis-proxyman', :git => 'https://github.com/ProxymanApp/atlantis.git', :commit => '7ee8312b13a6b872a0068bdf11bfc66511614c9f' ``` ### SPM - Checkout this commit: `7ee8312b13a6b872a0068bdf11bfc66511614c9f`
Author
Owner

@chrisknapp98 commented on GitHub (Nov 15, 2022):

seems to be working 👍
I censored the names because it would be the serial numbers

[Atlantis] Looking for Proxyman app in the network...
[Atlantis] 🔎 Found Proxyman at HostName = DEVICE_1.local.
[Atlantis] 🔎 Found Proxyman at HostName = DEVICE_2.local.
[Atlantis] 🔎 Found Proxyman at HostName = DEVICE_3.local.
[Atlantis] ✅ Connect to DEVICE_1.local.
[Atlantis] 🔎 Found Proxyman at HostName = DEVICE_4.local.
[Atlantis] ✅ Connect to DEVICE_2.local.
[Atlantis] ✅ Connect to DEVICE_3.local.
[Atlantis] ✅ Connect to DEVICE_4.local.
[Atlantis] 🔎 Found Proxyman at HostName = DEVICE_1.local.
[Atlantis] ⚠️ Avoid connecting to DEVICE_1.local. because it's already connected!
[Atlantis] Connection established
[Atlantis] Connection established
[Atlantis] Connection established
[Atlantis] Connection established
[Atlantis] 🔎 Found Proxyman at HostName = DEVICE_1.local.
[Atlantis] ⚠️ Avoid connecting to DEVICE_1.local. because it's already connected!
<!-- gh-comment-id:1315488324 --> @chrisknapp98 commented on GitHub (Nov 15, 2022): seems to be working 👍 I censored the names because it would be the serial numbers ``` [Atlantis] Looking for Proxyman app in the network... [Atlantis] 🔎 Found Proxyman at HostName = DEVICE_1.local. [Atlantis] 🔎 Found Proxyman at HostName = DEVICE_2.local. [Atlantis] 🔎 Found Proxyman at HostName = DEVICE_3.local. [Atlantis] ✅ Connect to DEVICE_1.local. [Atlantis] 🔎 Found Proxyman at HostName = DEVICE_4.local. [Atlantis] ✅ Connect to DEVICE_2.local. [Atlantis] ✅ Connect to DEVICE_3.local. [Atlantis] ✅ Connect to DEVICE_4.local. [Atlantis] 🔎 Found Proxyman at HostName = DEVICE_1.local. [Atlantis] ⚠️ Avoid connecting to DEVICE_1.local. because it's already connected! [Atlantis] Connection established [Atlantis] Connection established [Atlantis] Connection established [Atlantis] Connection established [Atlantis] 🔎 Found Proxyman at HostName = DEVICE_1.local. [Atlantis] ⚠️ Avoid connecting to DEVICE_1.local. because it's already connected! ```
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 16, 2022):

Thanks. Please play around with this update. If it's still working fine, I will release the fix this week 👍

<!-- gh-comment-id:1316186671 --> @NghiaTranUIT commented on GitHub (Nov 16, 2022): Thanks. Please play around with this update. If it's still working fine, I will release the fix this week 👍
Author
Owner

@NghiaTranUIT commented on GitHub (Nov 19, 2022):

Just a friendly reminder that I've bumped new version 1.20.0, which contains the fix.

However, if you've encountered this bug https://github.com/ProxymanApp/atlantis/issues/121 , Let's try the Proxyman beta build 👍

<!-- gh-comment-id:1320838685 --> @NghiaTranUIT commented on GitHub (Nov 19, 2022): Just a friendly reminder that I've bumped new version 1.20.0, which contains the fix. However, if you've encountered this bug https://github.com/ProxymanApp/atlantis/issues/121 , Let's try the Proxyman beta build 👍
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/atlantis#71
No description provided.