Simple HTTP server
Notes:
Signature | hs.httpserver.new([ssl], [bonjour]) -> object |
---|---|
Type | Function |
Description |
Creates a new HTTP or HTTPS server |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/httpserver/libhttpserver.m line 374 |
Signature | hs.httpserver:getInterface() -> string or nil |
---|---|
Type | Method |
Description |
Gets the network interface the server is configured to listen on |
Parameters |
|
Returns |
|
Source | extensions/httpserver/libhttpserver.m line 647 |
Signature | hs.httpserver:getName() -> string |
---|---|
Type | Method |
Description |
Gets the Bonjour name the server is configured to advertise itself as |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/httpserver/libhttpserver.m line 689 |
Signature | hs.httpserver:getPort() -> number |
---|---|
Type | Method |
Description |
Gets the TCP port the server is configured to listen on |
Parameters |
|
Returns |
|
Source | extensions/httpserver/libhttpserver.m line 616 |
Signature | hs.httpserver:maxBodySize([size]) -> object | current-value |
---|---|
Type | Method |
Description |
Get or set the maximum allowed body size for an incoming HTTP request. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/httpserver/libhttpserver.m line 513 |
Signature | hs.httpserver:send(message) -> object |
---|---|
Type | Method |
Description |
Sends a message to the websocket client |
Parameters |
|
Returns |
|
Source | extensions/httpserver/libhttpserver.m line 446 |
Signature | hs.httpserver:setCallback([callback]) -> object |
---|---|
Type | Method |
Description |
Sets the request handling callback for an HTTP server object |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/httpserver/libhttpserver.m line 466 |
Signature | hs.httpserver:setInterface(interface) -> object |
---|---|
Type | Method |
Description |
Sets the network interface the server is configured to listen on |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/httpserver/libhttpserver.m line 662 |
Signature | hs.httpserver:setName(name) -> object |
---|---|
Type | Method |
Description |
Sets the Bonjour name the server should advertise itself as |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/httpserver/libhttpserver.m line 707 |
Signature | hs.httpserver:setPassword([password]) -> object |
---|---|
Type | Method |
Description |
Sets a password for an HTTP server object |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/httpserver/libhttpserver.m line 539 |
Signature | hs.httpserver:setPort(port) -> object |
---|---|
Type | Method |
Description |
Sets the TCP port the server is configured to listen on |
Parameters |
|
Returns |
|
Source | extensions/httpserver/libhttpserver.m line 631 |
Signature | hs.httpserver:start() -> object |
---|---|
Type | Method |
Description |
Starts an HTTP server object |
Parameters |
|
Returns |
|
Source | extensions/httpserver/libhttpserver.m line 573 |
Signature | hs.httpserver:stop() -> object |
---|---|
Type | Method |
Description |
Stops an HTTP server object |
Parameters |
|
Returns |
|
Source | extensions/httpserver/libhttpserver.m line 599 |
Signature | hs.httpserver:websocket(path, callback) -> object |
---|---|
Type | Method |
Description |
Enables a websocket endpoint on the HTTP server |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/httpserver/libhttpserver.m line 415 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.httpserver.html