tg icon indicating copy to clipboard operation
tg copied to clipboard

Embedded reverse proxy service

Open 01es opened this issue 1 year ago • 1 comments

Description

This issue covers the work to establish an embedded Jetty-based proxy service that could be used in TG-based applications for various purposes without the need to utilise external proxy servers, such as HAProxy or nginx.

The driving use case is ability to facilitate the SSE capability, which uses a separate instance of Jetty, without an external proxy server. However, it is also envisaged that the proxy functionality can be useful for providing access to web services from web clients, without requiring those clients to provide all the information necessary to access the web services.

For example, Places API requires an API key for access. A web client is authenticated with a TG-based app's backend and should not contain information about such API key to make requests to Places API. This can be solved by using a proxy.

Configuration properties

Timeout values are in millis.

##############################
##### Jetty Proxy config #####
##############################
proxy.enabled=true
proxy.jetty.port=8090
proxy.jetty.threadPool.minThreads=5
proxy.jetty.threadPool.maxThreads=50
proxy.jetty.threadPool.idleTimeout=30000
proxy.jetty.connector.acceptors=2
proxy.backendTimeout=60000

Expected outcome

A proxy service that could have custom application logic with the out-of-the-box functionality for routing SSE requests.

01es avatar May 15 '24 03:05 01es

The core requirements have been implemented. However, before this issue can be considered completed, load testing needs to be performed to identify any potential bottlenecks.

01es avatar Mar 31 '25 07:03 01es