esp-open-lwip
esp-open-lwip copied to clipboard
redirect devices to specific website
I understand that there is some routing happening on the ESP. what I want to do now is to always route the devices connected to the ESP NAT to a specific website.
how can this be achieved ?
This can be done ba manipulating DNS or by rewriting addresses of HTTP requests. The challenge is, to switch off this redirect selectivley, once authentication is done.
I did an example with Arduino that does IP address-rewrite and switches the MAC addresses, once "authentication" has been done: You can find the code here: https://github.com/martin-ger/lwip_nat_arduino
DNS manipulation can be bypassed if the client chooses to use another DNS or access sites by IP. right ? so, rewriting HTTP requests would be better I think. I will study your code and keep you updated thanks dude
In CaptiveHotspot.ino, the hostspot doesn't have any internet access, does it ?
but wait, there is actually no source ( C ) files in esp_wifi_repeater I have been looking for source files to learn from them but can't find them anywhere
There are all sources in the user subdir.
In CaptiveHotspot.ino the ESP's STA side should be connected to the internet (the captive hotspot will work without, but then you get nothing once switched through).