-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Needs improvements for network interface selection for non-local mode #21
Comments
Do you create it with Hey @rafalzawadzki, any chance you can have a look into it? |
hi @birdofpreyru, you're correct: with one of my recent PRs I disabled fetching IP address for all interfaces other than wifi: 4a27a0e. This is because starting a server in most mobile networks does not work. It's rare for providers to assign static and externally accessible IP addresses. I am not very good with networking etc so I may be mistaken, lmk if you see use cases or simply a way to start such a server correctly? What we could also do is return IP address from native code normally, but also have another return value that lets the consumer know which interface that IP came from. |
Would it be possible to run the server on the hotspot interface? As far as I know both Android and iOS have a network interface for the hotspot network. |
Hmm... yeah, I don't know much about network interfaces, and consequences of launching the server on different of them. Technically, the Lighttp server will try to bind to any IP we tell him, and then it is the question to the OS and app permissions, whether it will be allowed to bind to the IP successfully. I guess, we can / should extend the library interface in this regard, say we provide a new function which queries the array of all network interfaces available on the device / the interfaces of selected kind; and we provide a new option of server constructor to start on any user-specified IP address. And then we'll leave it to each developer to figure out which network interface is appropriate for specific OS / use case. |
@birdofpreyru that sounds like an ideal solution. Furthermore, allowing users to specify more than one interface would be awesome as a server should be able to bind to multiple interfaces. Also, setting this parameter to The quick fix for the issue, before implementing the ideal solution described above, could be to bind the server to all available network interfaces by default, like setting it to |
Hey @birdofpreyru, any comments on my last post? Are there any updates regarding this? |
Hey @aostrun , no, I don't have any update. Resolving this issue is currently not too high on my priorities list, thus it probably will have to wait some time. |
@birdofpreyru Hi, I managed to start a server on mobile data on iOS. Here is my code snippet:
So, the temporary fix is to add these two lines before starting the server:
I also added the Network library to the project to be able to get the device's IP address. |
IOS server starts up when I'm on Wi-Fi and works, but when I'm on mobile data I can't start the server and I get a message that the server cannot be started and the URL is undefined.
The text was updated successfully, but these errors were encountered: