uWebSockets.js configuration. You should create it with UWSProxy.createUWSConfig
HTTP configuration of the target HTTP server. You should create it with UWSProxy.createHTTPConfig.
Proxy configuration options.
Private
_httpA shallow copy of the http configuration
Note that the config
property is the raw object passed as a parameter to
UWSProxy.createHTTPConfig.
A shallow copy of the uWebSocket configuration.
Note that the config
property is the raw object passed as a parameter to
UWSProxy.createUWSConfig.
Construct a valid error response based on the provided error. The error response will be sent (if possible) to the client. To change any of the default response, use a UWSProxyErrorHandler callback
The error we want to build a response upon
Handle a request received by uWebSockets.js and forward it to the http server.
Will try to respond to an error, either by using a UWSProxyErrorHandler (if any) or by sending a default error response.
The error that have been detected.
The response we want to write into.
Informations about the current request.
Make an attempt to send an UWSProxyErrorResponse to the client. This may produce no result if the UWSResponse have been aborted/closed already. This method will just fail silently if it happens.
The response we want to write into
The error to send.
Try to use the provided UWSProxyErrorHandler if it was specified in UWSProxyOpts at UWSProxy creation.
False if no handler is defined, true otherwise
The response we want to send an error into.
The raw error that have been detected.
Informations about the current request.
Static
createHTTPConfigCreate a valid httpConfiguration. The purpose of this method is to emit warnings or throw errors if the configuration doesn't seem valid.
It's also meant to be a helper for further updates, where new configuration options will be added.
using this method to configure UWSProxy is strongly recommended.
Optional
config: UWSProxyHTTPConfigOpts = {}Configuration object
Static
createUWSConfigCreates a valid uWebSockets.js configuration. The purpose of this method is to emit warnings or throw errors if the configuration doesn't seem valid.
It's also meant to be a helper for further updates, where new configuration options will be added.
using this method to configure UWSProxy is strongly recommended.
Generated using TypeDoc
A proxy based on uWebSockets.js. Allow for compatibility between uWebSockets.js and any HTTP server.
It is useful in restricted server environment like clouds where you can't set up a proxy, or if you don't want to use a proxy and need uWebSockets.js to work on the same port as any other http server you're already using like express, nestjs, fastify, etc.
Example with express:
See
More examples in the examples repository