runreflect / agent

The Reflect Agent allows secure connections between Reflect's cloud browsers and private web applications.
MIT License
5 stars 0 forks source link

Move to persistent connection with websocket #11

Closed fitzn closed 1 year ago

fitzn commented 1 year ago

Fixes #10

This commit updates the agent to use a websocket to maintain a persistent connection to the Reflect API over which Reflect can communicate when new sessions are created or completed. This removes the need to poll the Reflect API over HTTP to identify when the account's active sessions have changed. Additionally, it lowers the latency between session launch and the establishment of the wireguard connection to the host instance.

The agent sends an initial request for "sessions", but after that, it simply listens for the updated sessions information from the server. If the server disconnects or fails, the agent will retry the connection.

Tested