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.remoteCmdTxSerializer = "TXT" #or JSO
config.remoteCmdRxSerializers = ["TXT","JSO"] #or e.g. ["TXT"]
config.remoteFrmTxSerializer = "TXT" #or JSO
config.remoteFrmRxSerializer = "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.ssl 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.4.tar.gz (9.8 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.4-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for eoq3autobahnws-2.9.4.tar.gz
Algorithm Hash digest
SHA256 7c50dc992210ea8f0e0916cb2535636ba68a9450e7bb1fce57f1bfaeac4b75a5
MD5 360b7c7ccf03321c5a2ba9e584414923
BLAKE2b-256 2e8e25d9e16ef3ee1200d42067dd3e024ed5ab0ded2bf8ba6c2929e7a09030b8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for eoq3autobahnws-2.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d17eac8a4ce601822c44deb5cc13f3a81ee9bafff062a3dec5a3a2799fceac08
MD5 c3fa40ef0e3dfd9647cd7f704be72f0e
BLAKE2b-256 ce347efece8864c722d2672f04a18d29fd33385e6b8cde10d5e19bc317a0efb3

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