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
Built Distribution
File details
Details for the file eoq3autobahnws-2.9.0.tar.gz
.
File metadata
- Download URL: eoq3autobahnws-2.9.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 190a893259a02abd165d2c4bfa5e98c9f136ab7e52dd5bd90f4551f0e4badeaa |
|
MD5 | 8334f7affbdb54f28b8dbdd45e7aceb1 |
|
BLAKE2b-256 | 767a4be065ee4526b690d26bcac4ab7b63b4bceecd420a2f0e92929bf0d1715b |
File details
Details for the file eoq3autobahnws-2.9.0-py3-none-any.whl
.
File metadata
- Download URL: eoq3autobahnws-2.9.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d8cef6dddf5d09282229c6a653e9b5914a0893623beaca46d61c92bb842fe1c |
|
MD5 | aeafd4d713f1112bf4447c0eaef92e92 |
|
BLAKE2b-256 | c847535dabbcffbb0179d20cce8e0b418b60d2723a1417f4307bb074dbe7c598 |