- The propose is to abstract all the hard logic needed to operate a foward proxy network.
- It recives and store's foward tcp connections, by Jwt Auth and extends the net.Socket to allow the tcp foward connection to be used as a proxyxw
{ logginLevel: 6, port: 3000, host: 'localhost', keepAliveDelay: 10, keepAliveTimeout: 600, headersTimeout: 5,s jwtAuth: async (jwt: string, upstream: Upstream) => true, upstreamOptions: { keepAliveMaxTime: 60000, maxSocketPoolSize: 3, keepAliveRetryBeforeClose: 2, keepAliveDelay: 10 } };
. This binds a socket from the upstream refrenced by the Jwt in memory to the request. . This approach remove all the task id load from the server, allowing a better performance and less compute for each network request
. This starts the server by listen a defined port (IOptions.port)
. This ends a server by removing the listen and all the memory and Upstream connection.
. This endpoint is a GET request to the '/jwt' path. It is used to authenticate a user and manage upstream connections based on the provided JWT (JSON Web Token).
. RETURN
- A Iternalprotcol with the following properties:
- code: The HTTP like status code of the response.
- key: A string used to set the upstream on memory
. This endpoint is a GET request to the '/upstream' path. This endpoint is a GET request to the '/upstream' path. It is used to store the upsrtream
. RETURN
- A Iternalprotcol with the following properties:
- code: The HTTP like status code of the response.
- next: A boolean value indicating whether the user has more upstream connections to make.
. This endpoint is a GET request to the '/gate/id' path. It is used to authenticate a user and pipe the request connections based on the provided Id (key in memory).
. This exposes an prometheus object and allow better login within the Server instance.
. When a upstream connects and is Auth and ready to be use, sends the Upstream object
. When a upstream connections array are empty removes from memory, sends the Upstream object
. When a request fails to pipe , it returns the error
. Return an minifyed version of the hash key, helpfull with redis Key