Reference

TecoRoute Proxy library.

Example of asynchronous server startup:

from tecoroute_proxy import ProxyServer

async def proxy_server_start():
    server = ProxyServer(port=8080)
    await server.start()
class tecoroute_proxy.ProxyServer(host: str | None = None, port: int = 80, control: str = '/TR_PROXY', origin: str = 'http://route.tecomat.com:61682')[source]

Proxy server.

Parameters:
  • host – The host to listen on, all interfaces if None.

  • port – The port to listen on.

  • control – The control path.

  • origin – TecoRoute service URL.

async start() None[source]

Start the server asynchronously in the event loop.

async stop() None[source]

Stop the server.

class tecoroute_proxy.ProxyRequest(request: Request, origin: str = 'http://route.tecomat.com:61682')[source]

Proxy request.

Parameters:
  • request – User request.

  • origin – TecoRoute service URL.

async login(username: str, password: str, plc: str) Response[source]

Clear client cookies, save credentials and login.

Parameters:
  • username – TecoRoute username.

  • password – TecoRoute password.

  • plc – PLC to connect.

async logout() Response[source]

Delete credentials and logout.

async response() Response[source]

Make a proxy request and get a response.

async close() None[source]

Close request.

tecoroute_proxy.cli() None[source]

Run the command-line interface.