You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'd like to restrict the traffic to my http server to a specific netif, this could be done easily if there was a way to check the source ip of a request to do control flow like;
http_server.fn_handler("/",Method::Get,move |mut request| {let html = "hello world";let connection = request.connection();if connection.get_src_ip()? != Ipv4::new(10,10,10,1){returnErr(anyhow::anyhow!("Source ip forbidden"));}
connection.initiate_response(200,Some("OK"),&[("Content-Type","text/html")])?;
connection.write(html.as_bytes())?;Ok::<(),Error>(())})?;
I've looked at this forum post which is very interesting but doesn't really help me parse the very opaque http/server.rs to see where I would put this potential method.
Would you like to implement this feature? yes
A nudge in the right direction would be helpful, or maybe this isn't necessary at all and there's already a way to check this that I haven't found. Who knows.
The text was updated successfully, but these errors were encountered:
Hi, I'd like to restrict the traffic to my http server to a specific netif, this could be done easily if there was a way to check the source ip of a request to do control flow like;
I've looked at this forum post which is very interesting but doesn't really help me parse the very opaque
http/server.rs
to see where I would put this potential method.A nudge in the right direction would be helpful, or maybe this isn't necessary at all and there's already a way to check this that I haven't found. Who knows.
The text was updated successfully, but these errors were encountered: