Android Question Httpserver running on a hotspot 192.168.43.1

PhiloSophical

Member
Licensed User
Longtime User
If I switch my device to hotspot mode then a device connecting to it will find it on address 192.168.43.1.

Id like to configure Httpserver (library vn 1.00) so that it binds to this address. Unfortunately in this mode it can only seem to bind to 127.0.0.1 as its LAN address.

Is there something I've missed or is there a fix/config option I've missed. Maybe a later library version?

many thanks if someone can suggest a solution.

Phil
 

DonManfred

Expert
Licensed User
Longtime User
127.0.0.1 is localhost (the device itself). No matter what wifi ip it has.

Did you try to connect to the server at 192.168.43.1?
 
Upvote 0

PhiloSophical

Member
Licensed User
Longtime User
Thank you for your reply.

Yes, I did try - and that's my problem - it doesn't connect!.

HTTPserver only seems to recognise the LAN address of 127.0.0.1.

I'm guessing that under the hood there are multiple ethernet interfaces but there doesn't seem to be a way of Httpserver binding to anything other than the LAN interface. But I'm no expert!

Thanks

Phil
 
Upvote 0

PhiloSophical

Member
Licensed User
Longtime User
Thank you for this idea.

My use case is a Kindle Paperwhite running its experimental browser.
The kindle is being used as a display device in bright sunlight - think of it as a dashboard.
My mobile phone needs to stay in my pocket, is the hotspot, and may not be connected to either a wan or the internet.

Kindle points to 192.168.43.1:8080/page.html or similar.
Phone runs as a hotspot and collects GPS metrics publishing to an HTML page say page.html
page.html has a refresh every x seconds to keep refetching the latest status

Hope that explains the gist of the plot!

Thanks

Phil
 
Last edited:
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
Why do you want to use HttpServer? There might be better options. Mqtt with an embedded broker might work better.
I develop on B4A version 9.50 and use HttpServer version 1.00 on Windows 8.1 and can connect to the HTTP webserver locally on the same phone, with a browser via WiFi from a second phone or Windows 8.1 laptop, and via an Ethernet cable connected to the WiFi router from a Linux Mint laptop.
HTTP Server response.png
 

Attachments

  • HTTP Server.png
    HTTP Server.png
    72.8 KB · Views: 111
Upvote 0
Top