HTTP Server Class Pattern
The HTTP Server Class Pattern responds to HTTP/1.1 requests.
import HTTPServer from "embedded:network/http/server";Constructor
Section titled “Constructor”HTTPServer(options)
Section titled “HTTPServer(options)”Creates a new HTTPServer object instance.
HTTPServer(options)Parameters
Section titled “Parameters”options
io- An object containing aTCP Listenerclass constructor options object.
port- The port number to listen on.
onConnect(connection)- A callback function invoked when a new connection is initiated.
Instance Methods
Section titled “Instance Methods”close()
Section titled “close()”Closes the server and all active connections.