HttpServer
HttpServer
This class represents the HttpServer that was created using httpserver.Create
Metatable function | Description |
---|---|
__tostring |
Returns a formated string of the HttpServer -> HttpServer [Address:Port] |
__index |
Used to find the functions on the metatable and access saved variables |
__newindex |
Used to allow one to save variables on the object |
Methods
Adds the given Delete path to the HttpServer.
Adds the given Get path to the HttpServer.
string HttpServer:GetAddress( )
Returns the address that was originally passed to HttpServer:Start
Returns the name set by HttpServer:SetName, defaults to
NONAME
Returns the port that was originally passed to HttpServer:Start
Adds the given Options path to the HttpServer.
Adds the given Patch path to the HttpServer.
Adds the given Post path to the HttpServer.
Adds the given Put path to the HttpServer.
HttpServer:RemoveMountPoint( string mountPoint )
This removes all mounts for the given path.
HttpServer:SetKeepAliveMaxCount( number amount )
Sets the maximum amount of connections that can be kept alive at the same time.
HttpServer:SetKeepAliveTimeout( number sec )
Sets the maximum time a connection is kept alive.
This mounts the given folder to the given path.
You can call this multiple times for the same path to mount multiple folders to it.
Sets the name of the HttpServer.
The length of the name is limited to 64 characters.
The length of the name is limited to 64 characters.
HttpServer:SetPayloadMaxLength( number maxLength )
Sets the maximum payload length.
Sets the maximum amount of time before a read times out.
HttpServer:SetTCPnodelay( boolean noDelay )
Sets whether a delay should be added to tcp or not.
HttpServer:SetThreadSleep( number sleepTime )
The number of ms threads sleep before checking again if a request was handled.
Useful to raise it when you let requests wait for a while.
Useful to raise it when you let requests wait for a while.
Sets the maximum amount of time before a write times out.
This will start or restart the HTTP Server, and it will listen on the given address + port.
If a Method function like HttpServer:Get was called after this was called, you need to call this function again!
HttpServer:Stop()
This stops the HTTP Server.
HttpServer:Think()
Goes through all requests and calls their callbacks or deletes them after they were sent out.
This is already internally called every frame, so you don't need to call this.