Skip to main content

Websocket domain client and host using autobahn

Project description

eoq3autobahnws - Websocket domain client and host using autobahn

A domain server makes a local domain accessible via a WS port.

A domain host connects to a remote domain using WS.

client and server are based on autobahn: https://autobahn.readthedocs.io/en/latest/index.html

Usage

Define serialization and timeouts

config = Config()
config.remoteCmdSerializer = "TXT" #or JSO
config.connectTimeout = 40

Host

Imports:

from eoq3autobahnws.autobahnwsdomainhost import AutobahnWsDomainHost

Create an SSL factory (optional):

def ServerSslFactory(sslFactoryArgs:dict):
    return CreateSelfSignedServerSslContext("ssl/certificate.pem", "ssl/key.pem", "ILS-admin")

Creating a TCP host domain that provides acces to another domain "localDomain", e.g. DomainWithMdb:

server = AutobahnWsDomainHost(localDomain, True, '127.0.0.1', 5141, nWorkers=N_THREADS, config=config) #no ssh

server = AutobahnWsDomainHost(localDomain, True, '127.0.0.1', 5141, sslContextFactory=ServerSslFactory, nWorkers=N_THREADS, config=config) #with ssh

Client

Imports:

from eoq3autobahnws.autobahnwsdomainclient import AutobahnWsDomainClient
from eoq3autobahnws.util import CreateClientSslContextForSelfSignedServerCert

Create an SSL factory (optional):

def ClientSslFactory(domainFactoryArgs:dict): 
    return CreateClientSslContextForSelfSignedServerCert("ssl/certificate.pem")

Connecting to a remote domain:

domain = AutobahnWsDomainClient('127.0.0.1',5141) #no ssl

domain = AutobahnWsDomainClient('127.0.0.1',5141,sslContextFactory=ClientSslFactory) #with ssl

Examples

See

  • pyeoq/Examples/Eoq3/BasicWebsocketServer.py and
  • pyeoq/Examples/Eoq3/BasicWebsocketDomain.py

Documentation

For more information see EOQ3 documentation: https://eoq.gitlab.io/doc/eoq3/

Author

2024 Bjoern Annighoefer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eoq3autobahnws-2.9.2.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eoq3autobahnws-2.9.2-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file eoq3autobahnws-2.9.2.tar.gz.

File metadata

  • Download URL: eoq3autobahnws-2.9.2.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for eoq3autobahnws-2.9.2.tar.gz
Algorithm Hash digest
SHA256 e23901c59c3cd72c18c5cd3dd5e8725902dad9c7327b85d048118ae813efa63d
MD5 c1869584bffd09697d8c8d4141295bfc
BLAKE2b-256 0230c973a9c30f426efbca31e71f09414217729c7663410a7cb95bbd4597c92a

See more details on using hashes here.

File details

Details for the file eoq3autobahnws-2.9.2-py3-none-any.whl.

File metadata

  • Download URL: eoq3autobahnws-2.9.2-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for eoq3autobahnws-2.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3748b56cdf401297e44109221e304a323ca7f4b9bb456f9b9396f5ab3827c12
MD5 5f8e076be311650630f69dcb88bc6835
BLAKE2b-256 0611fb404386f4954595903d19d9c74b7f495bb3487116dfa5593fa767fa2bd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page