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.1.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

eoq3autobahnws-2.9.1-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for eoq3autobahnws-2.9.1.tar.gz
Algorithm Hash digest
SHA256 61d17eff1b84cb83209fac851aee2609ddfdbf4ff08204176aa43a9bdc6286d9
MD5 117971b44c4b8a84202fd28e494e4d92
BLAKE2b-256 1aa6650fb364aa748b087daa491459ef2cee98db0570435b3e3e08ceaac9e555

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for eoq3autobahnws-2.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5e22ec67222eb57c5f6288a3065135e31d8e8ff0433695fb6ee612029e52b64c
MD5 112534b994df43897055c8c7ee05cd1d
BLAKE2b-256 89b036d888719a4ab2c3b815d3e02d887f79bf83dcef35c36cbda32a53aed1c1

See more details on using hashes here.

Supported by

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