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.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.3.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.3-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eoq3autobahnws-2.9.3.tar.gz
  • Upload date:
  • Size: 9.8 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.3.tar.gz
Algorithm Hash digest
SHA256 80489befc6be68c35be488d2396502e13f3efd35df30b1c891300d5f6ff52c42
MD5 243fbd4bbabe77b77bcf19f091575c34
BLAKE2b-256 31cd567a683c9c38866398c775b8c5c5bfca81b287ccfd3fab764f4f9f5c3b59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eoq3autobahnws-2.9.3-py3-none-any.whl
  • Upload date:
  • Size: 12.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 47a5d67fe283170ea588594cba667fedb4f5cb823a152fdb8ea5f09fcf264558
MD5 0cc60a21a12885c2ed4a6f44f9546f2e
BLAKE2b-256 49d357ac7d42714fe005cfe74fbb54fc8c329e5c013473b15d13c3f92a30f96a

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