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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for eoq3autobahnws-2.9.1-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | 5e22ec67222eb57c5f6288a3065135e31d8e8ff0433695fb6ee612029e52b64c |
|
| MD5 | 112534b994df43897055c8c7ee05cd1d |
|
| BLAKE2b-256 | 89b036d888719a4ab2c3b815d3e02d887f79bf83dcef35c36cbda32a53aed1c1 |