SpriteHTTPD - embedded HTTP server with read-only filesystem and templating, originally developed for ESP8266, now stand-alone and POSIX compatible.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
spritehttpd/spritehttpd/include/cgi-redirects.h

33 lines
916 B

/**
* General purpose CGI redirects
*/
#pragma once
#include "httpd-types.h"
/**
* Use this as a cgi function to redirect one url to another.
*
* - arg1 is the URL.
*/
httpd_cgi_state cgiRedirect(HttpdConnData *connData);
/**
* This CGI function redirects to a fixed url of http://[hostname]/ if hostname field of request isn't
* already that hostname. Use this in combination with a DNS server that redirects everything to the
* ESP in order to load a HTML page as soon as a phone, tablet etc connects to the ESP. Watch out:
* this will also redirect connections when the ESP is in STA mode, potentially to a hostname that is not
* in the 'official' DNS and so will fail.
*
* - arg1 is the new hostname
*
* @param conn - connection
*/
httpd_cgi_state cgiRedirectToHostname(HttpdConnData *connData);
/**
* Used to spit out a 404 error
*/
httpd_cgi_state cgiNotFound(HttpdConnData *connData);