Block access to web server on specified interface

User avatar
jrakus
Posts: 6
Joined: Mon Aug 05, 2019 12:09 pm

Block access to web server on specified interface

Postby jrakus » Thu Mar 19, 2020 11:58 am

Hi all!

Currently I've been playing with HTTP server on ESP32. Works nearly perfect, I've implemented even some simple CORS-related features. But now there is a little problem - I could make HTTP requests to my ESP32 on both wireless interfaces - STA and AP, but I'd like to restrict access only for clients connected to Soft AP generated by ESP. In other words: HTTP server shall not respond to requests received from wireless net which ESP connects to as a station.

Are there any options to do that? Block ports on specified interface? Filter requests on HTTP server level? But how? I can't see any function/library/API which may help with this.

Jakub

ryanf55
Posts: 8
Joined: Sun Mar 22, 2020 7:15 am

Re: Block access to web server on specified interface

Postby ryanf55 » Sun Mar 22, 2020 7:25 am

Do you use netconn_bind() when starting the server; that can be bound to a port and may accomplish what you need. I may have to do the same thing soon too so I will let you know if that does work.

Is your code for station+AP public? I am working on that but am not sure how to handle turning on and off each of the wifi interfaces.

Who is online

Users browsing this forum: No registered users and 72 guests