Add unix socket support
This commit is contained in:
@ -45,10 +45,12 @@ namespace Tesses::Framework::Http
|
||||
|
||||
std::string method;
|
||||
std::string url;
|
||||
std::string unixSocket;
|
||||
HttpDictionary requestHeaders;
|
||||
HttpRequestBody* body;
|
||||
|
||||
static Tesses::Framework::Streams::Stream* EstablishConnection(Uri uri,bool ignoreSSLErrors,std::string trusted_root_cert_bundle);
|
||||
static Tesses::Framework::Streams::Stream* EstablishUnixPathConnection(std::string unixPath, Uri uri, bool ignoreSSLErrors, std::string trusted_root_cert_bundle);
|
||||
|
||||
void SendRequest(Tesses::Framework::Streams::Stream* strm);
|
||||
};
|
||||
@ -77,8 +79,22 @@ namespace Tesses::Framework::Http
|
||||
void DownloadToFileSimple(std::string url, Tesses::Framework::Filesystem::VFS& vfs, Tesses::Framework::Filesystem::VFSPath path);
|
||||
void DownloadToFileSimple(std::string url, Tesses::Framework::Filesystem::VFSPath path);
|
||||
std::string DownloadToStringSimple(std::string url);
|
||||
|
||||
bool WebSocketClientSuccessDefault(HttpDictionary& dict,bool v);
|
||||
void WebSocketClient(std::string url, HttpDictionary& requestHeaders, WebSocketConnection& wsc, std::function<bool(HttpDictionary&,bool)> cb=WebSocketClientSuccessDefault);
|
||||
void WebSocketClient(std::string url, HttpDictionary& requestHeaders, WebSocketConnection* wsc, std::function<bool(HttpDictionary&,bool)> cb=WebSocketClientSuccessDefault);
|
||||
|
||||
|
||||
void DownloadUnixSocketToStreamSimple(std::string unixSocket,std::string url, Tesses::Framework::Streams::Stream* strm);
|
||||
void DownloadUnixSocketToStreamSimple(std::string unixSocket,std::string url, Tesses::Framework::Streams::Stream& strm);
|
||||
|
||||
void DownloadUnixSocketToFileSimple(std::string unixSocket,std::string url, Tesses::Framework::Filesystem::VFS* vfs, Tesses::Framework::Filesystem::VFSPath path);
|
||||
void DownloadUnixSocketToFileSimple(std::string unixSocket,std::string url, Tesses::Framework::Filesystem::VFS& vfs, Tesses::Framework::Filesystem::VFSPath path);
|
||||
|
||||
void DownloadUnixSocketToFileSimple(std::string unixSocket,std::string url, Tesses::Framework::Filesystem::VFSPath path);
|
||||
std::string DownloadUnixSocketToStringSimple(std::string unixSocket,std::string url);
|
||||
|
||||
|
||||
void WebSocketUnixSocketClient(std::string unixSocket,std::string url, HttpDictionary& requestHeaders, WebSocketConnection& wsc, std::function<bool(HttpDictionary&,bool)> cb=WebSocketClientSuccessDefault);
|
||||
void WebSocketUnixSocketClient(std::string unixSocket,std::string url,HttpDictionary& requestHeaders, WebSocketConnection* wsc, std::function<bool(HttpDictionary&,bool)> cb=WebSocketClientSuccessDefault);
|
||||
}
|
||||
@ -88,6 +88,7 @@ namespace Tesses::Framework::Http
|
||||
bool ownsTCP;
|
||||
bool ownsHttp;
|
||||
bool showIPs;
|
||||
bool showARTL;
|
||||
|
||||
public:
|
||||
HttpServer(Tesses::Framework::Streams::TcpServer& tcpServer, IHttpServer& http, bool showIPs=true);
|
||||
@ -96,6 +97,8 @@ namespace Tesses::Framework::Http
|
||||
HttpServer(Tesses::Framework::Streams::TcpServer* tcpServer, bool ownsTCP, IHttpServer* http, bool ownsHttpServer, bool showIPs=true);
|
||||
HttpServer(uint16_t port, IHttpServer& http, bool showIPs=true);
|
||||
HttpServer(uint16_t port, IHttpServer* http, bool owns, bool showIPs=true);
|
||||
HttpServer(std::string unixPath, IHttpServer& http);
|
||||
HttpServer(std::string unixPath, IHttpServer* http, bool owns);
|
||||
uint16_t GetPort();
|
||||
void StartAccepting();
|
||||
static void Process(Tesses::Framework::Streams::Stream& strm, IHttpServer& server, std::string ip, uint16_t port, bool encrypted);
|
||||
|
||||
Reference in New Issue
Block a user