mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 15:55:46 +00:00
Add changeable server
This commit is contained in:
14
include/TessesFramework/Http/ChangeableServer.hpp
Normal file
14
include/TessesFramework/Http/ChangeableServer.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include "HttpServer.hpp"
|
||||
|
||||
namespace Tesses::Framework::Http
|
||||
{
|
||||
class ChangeableServer {
|
||||
public:
|
||||
ChangeableServer();
|
||||
ChangeableServer(std::shared_ptr<IHttpServer> original);
|
||||
std::shared_ptr<IHttpServer> server;
|
||||
bool Handle(ServerContext& ctx);
|
||||
~ChangeableServer();
|
||||
};
|
||||
}
|
||||
@@ -56,8 +56,15 @@ namespace Tesses::Framework::Http
|
||||
ServerContext& WithMimeType(std::string mime);
|
||||
ServerContext& WithContentDisposition(std::string filename, bool isInline);
|
||||
ServerContext& WriteHeaders();
|
||||
ServerContext& WithLocationHeader(std::string url);
|
||||
ServerContext& WithLocationHeader(std::string url,StatusCode sc);
|
||||
void StartWebSocketSession(std::function<void(std::function<void(WebSocketMessage&)>,std::function<void()>,std::function<void()>)> onOpen, std::function<void(WebSocketMessage&)> onReceive, std::function<void(bool)> onClose);
|
||||
void StartWebSocketSession(std::shared_ptr<WebSocketConnection> connection);
|
||||
std::string GetServerRoot();
|
||||
std::string MakeAbsolute(std::string path);
|
||||
void SendRedirect(std::string url);
|
||||
void SendRedirect(std::string url, StatusCode sc);
|
||||
|
||||
|
||||
template<class T>
|
||||
T* GetServerContentData(std::string tag)
|
||||
|
||||
Reference in New Issue
Block a user