coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
512 stars 258 forks source link

How to access UAMSERVER (/json/logon/) from WAN side #542

Open raman-nbg opened 2 years ago

raman-nbg commented 2 years ago

I was able to setup Coova Chilli and get it running in a minimal setup. Also, I'm able to access the splash page which is located somewhere in the internet from the client through coova chilli. The splash page brings some UI with JavaScript and this JavaScript (running in the browser) can send the request to $UAMIP:$UAMPORT/json/logon?.... Everything works fine so far.

Now I want to send the request to $UAMIP:$UAMPORT/json/logon?... from the server/backend of my splash page. But I can't reach the UAMSERVER because, the $UAMIP is not reachable from the internet/WAN. Also, it would be better to access this by using a domain/hostname instead of using an IP.

Running the command sudo lsof -i -P -n | grep LISTEN I can see that chilli is listening on 10.1.0.1:3990 (and not on *:3990).

How can I get this working? Is there some config parameter that I need to change for this? What is the recommended way?

pavankn commented 2 years ago

Try with dns1 8.8.8.8 in chilli config , i did similar thing and was able to reach external captive portal

kmrinal commented 2 years ago

No, you cannot call UAMIP from the server-side. UAMIP is on the LAN side, which is getting NATed to WAN. You will have to trigger a call to the JSON endpoint from the frontend, using JS/JQuery etc or a redirect.