-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add remote host/port options for use when forwarding. #2807
Conversation
In "adb forward" mode, by default, scrcpy connects to localhost:PORT, where PORT is the local port passed to "adb forward". This assumes that the tunnel is established on the local host with a local adb server (which is the common case). For advanced usage, add --tunnel-host and --tunnel-port to force the connection to a different destination. Fixes #2801 <#2801> PR #2807 <#2807> Signed-off-by: Romain Vimont <rom@rom1v.com>
Thank you very much. Works as expected 👍 I applied the following changes:
The resulting branch is pr2807. Please review and test :) Could you please provide a real e-mail address? Your commit author is currently:
I did a similar thing recently, but I defined the variable directly in the source code, not via meson. It's more local and does not complexify the build system.
This is off-topic. And it would require more work (configure more options in the |
I'm using that email specifically for privacy(see https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address). _WIN32_WINNT and WINVER should be defined at the project level, not in some files and not in others. Windows API version used should be consistent among the whole project. I don't really care about the .clang-format but it was a terrible experience trying to contribute to the project without one(I just set enough options for it to format the functions correctly). I like the other changes 👍 . |
OK.
Here is what the GNU documentation says:
Is it different for Windows?
What's your editor? |
The goal of _WIN32_WINNT/WINVER is to indicate a minimum API version(and thus windows version) necessary for the program to run, win32 api is backward compatible(sometimes to a fault) so there is no drawback to setting the minimum project wide(unlike the cited page which has an explanation about incompatible standards).
You know what's the point of .clang-format? Not having to worry about which editor people are using ;). |
Hmm, in fact, the way these feature test macros are currently defined is not very good: Lines 4 to 9 in 57fb08e
In VLC, in fact we define them in |
In "adb forward" mode, by default, scrcpy connects to localhost:PORT, where PORT is the local port passed to "adb forward". This assumes that the tunnel is established on the local host with a local adb server (which is the common case). For advanced usage, add --tunnel-host and --tunnel-port to force the connection to a different destination. Fixes #2801 <#2801> PR #2807 <#2807> Signed-off-by: Romain Vimont <rom@rom1v.com>
Add 2 new options:
--tunnel-host to set the final remote IP address when using --force-adb-forward.
--tunnel-port to set the final remote port when using --force-adb-forward.
Note that those are different from the forwarding port given through --port(as adb will still forward on that port).
I tried to keep the changes relatively minimal(ie if you don't use the options it will behave as it used to).
I also added a .clang-format file as every C/C++ project should have one.
Another notable change is I forced _WIN32_WINNT and WINVER to 0x0600(from mingw default of 0x0502) through meson to have access to a few more posix inet functions for windows.
Implement #2801.