Multiple port support for --forwardPort
. (already implemented, ready to pull)
#7843
emanuele-scarsella
started this conversation in
Ideas
Replies: 1 comment
-
In the meanwhile, if you need this feature a I do, you can use patch-package downloading this patches.zip. npx cap run android -l --external --forwardPorts 8080:8080 9000:9000 You are welcome. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was developing an app with capacitor that should communicate with two back-and servers developed in the same monorepo, when I went to test the app I found myself in the awkward situation where while I can test the web interface whit live reloading, there seems to be no way to have both live reload and multiple server port forwarding at the same time (or at the very least, not without re-defining my laptop IP address address every time it changes).
The reason being the
cap run android
only accepts one parameter as--forwardPort
, but by looking at the code it become instantly clear that implementing multiple port forwarding really is a piece of cake sincenative-run
already supports multiple--forward
arguments.It's so easy in fact that I forked the project and implemented it by changing just 3 lines of code with this commit.
The good things about this new features are:
But even if I consider this change to be very trivial, that's still a change in the cli interface, so I thought it might be wiser to open a discussion and get some feedback before making a potentially unwanted pull request especially since there are already 49 open pull requests.
Beta Was this translation helpful? Give feedback.
All reactions