ProxymanApp / atlantis

Capture HTTP/HTTPS, and Websocket from iOS app without proxy.
https://proxyman.io
Apache License 2.0
1.25k stars 93 forks source link

Handle multiple devices (Proxyman instances) #72

Open djbe opened 3 years ago

djbe commented 3 years ago

One thing we noticed during the implementation of Atlantis for Android, is that Atlantis only maintains one connection (task, see here) in total.

Whenever it finds and resolves a new service (i.e. a new Proxyman instance), it connects to it. In the process of establishing that connection, it closes any previous connections.

It would be better if Atlantis would seamlessly handle multiple Proxyman instances, like Bagel does. It's extremely useful in an office environment, so we can easily help each other out in debugging network communication per device/app/...

NghiaTranUIT commented 3 years ago

Sorry for the late reply. I completely missed it.

At the moment, as you mention, Atlantis only maintains one connection. I don't think it's a good idea if we support multiple connections by default.

If one user starts Atlantis with default param:

Atlantis.start()

Then, all colleagues, who are opening Proxyman, can see the traffic. Even though they don't want to.

It also a reason why we introduce the hostname to connect to a specific computer.

Atlantis.start(hostName: "_your_host_name")
djbe commented 3 years ago

The thing is, Atlantis doesn't support multiple connections at all right now. What happens right now is more undefined behaviour, whichever is the latest Proxyman instance to be detected, is the one it will connect to (all the other ones it will connect to, and disconnect once a new one is discovered).

Bagel has the same option of defining a hostname, and sure, keep that, it's good to have that. But Bagel by default supports multiple connections, which is much much easier to use for everyone.

But this does not work when you have multiple developers working on an app. Now everyone is changing the Atlantis startup code, to replace the host name with their own. You either have to remember to never commit that (which no one remembers), or people keep committing changes to that line (which dirties your git history with useless changes). Or even worse, sometimes because of network/system issues your hostname changes (to "devicename-1", "device-name-2", ...), and suddenly Atlantis stops working for all those users until they somehow find out that their hostname changed 🤷.

So the default should be connect to all Proxyman instances. Easy to use for everyone, nothing they have to worry about. Only people that don't want connections from everyone should provide a hostname during startup.

khoogheem commented 3 years ago

Yep. I would love to see proxyman work correctly when you have the same Application running on Device and on Simulator. Currently Proxyman shows both devices.. but the data that gets displayed seems to be the same across both devices, but it its the data from the first connected device

RiyanFransen commented 2 years ago

I also have this issue, we have multiple co-workers working on the same project/code base concurrently on the same network. We have noticed that Atlantis connects to random computers on the network, making it impossible consistently. Issue is resolved by either restarting the Proxyman application and/or restarting the application we are working on.

Note that setting the application to connect to a specified computer is not an options as we are collaborating on the same projects concurrently.

NghiaTranUIT commented 2 years ago

Thanks for your feedback @RiyanFransen

Note that setting the application to connect to a specified computer is not an options as we are collaborating on the same projects concurrently.

I'm not sure why connecting to a specific computer (by using Atlantis.start(hostName: "_your_host_name")) is not an option? From what implement, if you define a hostname, Atlantis will only connect to this machine, not your co-worker, even though you're collaborating on the same project.

NghiaTranUIT commented 2 years ago

@RiyanFransen I assume that you're using the default method, which is Atlantis.start(). Therefore, it will randomly connect to the first machine, which is discovered by Bonjour Service.

The problem of @djbe is quite different. It means Proxyman "should" maintain multiple Atlantis connections (For instance, 1 iPhone and 1 iPad are connecting to Proxyman via Atlantis)

RiyanFransen commented 2 years ago

I'm not sure why connecting to a specific computer (by using Atlantis.start(hostName: "_your_host_name")) is not an option? From what implement, if you define a hostname, Atlantis will only connect to this machine, not your co-worker, even though you're collaborating on the same project.

Like I said, we are a development team with multiple developers working on the same project. It is not an option to hardcode the specific hostname for each of our computers as this would create a lot of overhead. Not to mention that we cross check our calls together with the backend developers to more swiftly fix bugs. I hope this case explains our work situation better, if you have any more questions please feel free to ask.

NghiaTranUIT commented 2 years ago

Thanks. I understand your situation 👍

What if Atlantis will provide a screen that displays all available machines, then you can manually select a machine that you'd like to connect (in runtime). I suppose it could solve your problem.

The only solution to work around before I implement this feature is that using Atlantis.start(hostName: "_your_host_name"). You might not need to hardcode & commit, I guess you can modify it in compile time during the testing.

RiyanFransen commented 2 years ago

@NghiaTranUIT That's unfortunately not a solution to our problem, as previously mentioned we use the tool together with backend developers. So we actually want it to broadcast to multiple computers. It appears to be (as @djbe mentioned) that Atlantis has difficulties keeping connections when new instances of Proxyman are opened on the network.

It would be better if Atlantis would seamlessly handle multiple Proxyman instances, like Bagel does. It's extremely useful in an office environment, so we can easily help each other out in debugging network communication per device/app/...

NghiaTranUIT commented 2 years ago

@RiyanFransen @djbe Good news that I'm working on this essential feature at https://github.com/ProxymanApp/atlantis/pull/90

I will test with multiple Proxyman app on different Mac devices this week and send you guys a beta build soon 🙌

Thanks again for following up 🥇

NghiaTranUIT commented 2 years ago

Good news @RiyanFransen @djbe 🎉

I've released Atlantis 1.13.0, Atlantis now maintains multiple connections to Proxyman apps on different Mac machines.

Connect to multiple Mac devices

If we use

Atlantis.start()

Then, Atlantis will connect to all Macbooks, which are in the same Network and have opened Proxyman app. 1 Request/Response will broadcast to all Macbooks at the same time.

Connect to particular Mac device

If we use

Atlantis.start(hostName: "My_host_Name")

Then, Atlantis will only connect to this particular Mac machine.


Please let me know if it works for you 👍

NghiaTranUIT commented 2 years ago

and I would say sorry for the delay on this feature implementation 🙇

djbe commented 2 years ago

Fantastic news! :tada: Will have to try it when I'm back in the office (currently on holidays).

Edit: I think this issue can be closed then?

NghiaTranUIT commented 2 years ago

Feel free to keep it open until we're happy with this update 👍

RiyanFransen commented 2 years ago

@NghiaTranUIT Awesome big thanks! Unfortunately now we aren't permitted to go to the office with a big group so I won't be able to confirm the feature/fix in the foreseeable future. Feel free to close the issue, we'll give a heads up if we spot something!

RiyanFransen commented 2 years ago

@NghiaTranUIT We are happy with the update, issue can be closed. Many thanks for the enhancement!

NghiaTranUIT commented 2 years ago

You're welcome @RiyanFransen 🎉