pyexpose.providers package

Submodules

pyexpose.providers.localhost_run module

class pyexpose.providers.localhost_run.LocalRunConnector[source]

Bases: ExposeConnector

Connector to localhost.run service, It only supports HTTP/HTTPS endpoints right now

from pyexpose.providers.localhost_run import LocalRunConnector
connector = LocalRunConnector()
async with serveo.connect() as session:
    async with session.tunnel(8080) as tunnel:
        print("localhost.run exposed ip is " + tunnel.ip)
get_factory() Callable[[], LocalRunSession][source]

Returns a factory function that creates a new ExposeSessionVar instance.

Returns:

A factory function that creates a new ExposeSessionVar instance.

Return type:

Callable[[], ExposeSessionVar]

open_connection() AsyncIterator[SSHClientConnection][source]

Opens a connection to the server, Override this for creating new connectors

Returns:

asyncssh.SSHClientConnection

Return type:

AsyncIterator[asyncssh.SSHClientConnection]

class pyexpose.providers.localhost_run.LocalRunSession(session: SSHClientConnection, stdin: SSHWriter, stdout: SSHReader, stderr: SSHReader)[source]

Bases: ExposeSession

Session for localhost.run service

async parse_ip_port()[source]

Parses the ip address and port from the server.

Returns:

The ip address and port.

Return type:

Tuple[str, int]

pyexpose.providers.serveo module

class pyexpose.providers.serveo.ServeoConnector[source]

Bases: ExposeConnector

Provider to connect to serveo.net, a free ssh tunneling service.

from pyexpose.providers.serveo import ServeoConnector
connector = ServeoConnector()
async with connector.connect() as session:
    async with session.tunnel(8080) as tunnel:
        print("serveo.net exposed ip is " + tunnel.ip)
get_factory() Callable[[], ServeoSession][source]

Returns a factory function that creates a new ExposeSessionVar instance.

Returns:

A factory function that creates a new ExposeSessionVar instance.

Return type:

Callable[[], ExposeSessionVar]

open_connection() AsyncIterator[SSHClientConnection][source]

Opens a connection to the server, Override this for creating new connectors

Returns:

asyncssh.SSHClientConnection

Return type:

AsyncIterator[asyncssh.SSHClientConnection]

class pyexpose.providers.serveo.ServeoSession(session: SSHClientConnection, stdin: SSHWriter, stdout: SSHReader, stderr: SSHReader)[source]

Bases: ExposeSession

Session for serveo

async parse_ip_port()[source]

Parses the ip address and port from the server.

Returns:

The ip address and port.

Return type:

Tuple[str, int]

Module contents