Unreal Engine Plugin
HTTP Server
How to use HTTP server class
References
#include "http/httpserver.h"
How to use
Blueprint: search by GetInternetProtocolSubsystem
and call CreateHttpServer
function
C++: Use the code bellow
#include "http/httpserver.h"
UHttpServer* net = NewObject<UHttpServer>();
Variables
Backlog
- Set/Get the maximum number of simultaneous client connections the server will accept in queue.
Backlog
Idle Timeout Seconds
- Set/Get timeout value in seconds
Idle Timeout Seconds
Functions
Is Open
- Return true if socket is open.
𝑓
Is Open
Return Value
Local Endpoint
- Get the local endpoint of the socket. Use this function only after open connection.
𝑓
Local Endpoint
Return Value
Clients
- Gets a constant reference to the set of clients connected to the server.
𝑓
Clients
Return Value
Get Error Code
- Return a struct of the latest error code returned by asio.
𝑓
Get Error Code
Return Value
Open
- Opens the TCP server and starts listening for incoming connections.
- It returns false if socket is already open or if asio return any error code during the bind.
𝑓
Open
Target is Http Server
Target
Bind Opts
Return Value
Close
- Close the underlying socket and stop listening for data on it. 'on_close' event will be triggered.
𝑓
Close
Target is Http Server
Target
All
- Create a callback to receive requests of any methods for a specific path.
𝑓
All
Target is Http Server
Target
Path
Callback
On All
Custom Event
Request
Response
Get
- Create a callback to receive requests of get method for a specific path.
𝑓
Get
Target is Http Server
Target
Path
Callback
On Get
Custom Event
Request
Response
Post
- Create a callback to receive requests of post method for a specific path.
𝑓
Post
Target is Http Server
Target
Path
Callback
On Post
Custom Event
Request
Response
Put
- Create a callback to receive requests of put method for a specific path.
𝑓
Put
Target is Http Server
Target
Path
Callback
On Put
Custom Event
Request
Response
Del
- Create a callback to receive requests of del method for a specific path.
𝑓
Del
Target is Http Server
Target
Path
Callback
On Del
Custom Event
Request
Response
Head
- Create a callback to receive requests of head method for a specific path.
𝑓
Head
Target is Http Server
Target
Path
Callback
On Head
Custom Event
Request
Response
Options
- Create a callback to receive requests of options method for a specific path.
𝑓
Options
Target is Http Server
Target
Path
Callback
On Options
Custom Event
Request
Response
Patch
- Create a callback to receive requests of patch method for a specific path.
𝑓
Patch
Target is Http Server
Target
Path
Callback
On Patch
Custom Event
Request
Response
Events
On Close
- Event triggered when socket is closed.
Bind Event to On Close
Target
Event
On Close
Custom Event
On Error
- Event triggered if any error occur during async process.