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.5.tar.gz (9.9 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.5-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for eoq3autobahnws-2.9.5.tar.gz
Algorithm Hash digest
SHA256 f228e0595adda9bbfda4eb4de0550dc8e49dc4b72f123d945f7a1c410fcb01ae
MD5 7b4344a3c1ae990b47c8a260528fb195
BLAKE2b-256 d500de4d58a7a7f8384fdba3b506d06f341da27870abf7916a9ab2244868ccea

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for eoq3autobahnws-2.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 28dbcb7b14453219aeae509b5d42c238462ec3d7f00093d7a3617fb9445dc1c2
MD5 113c1039f497b1f3600c8b1333ba09a2
BLAKE2b-256 f1ef3315188268527cda33d879317b911f4ab14465a7ac711248b046edb25893

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