A Python SignalR Core client
Project description
SignalR core client
Example
Using package from aspnet core example chat without auth
from signalrcore.hub_connection import HubConnection
def input_with_default(input_text, default_value):
value = input(input_text.format(default_value))
return default_value if value is None or value.strip() == "" else value
server_url = input_with_default('Enter your server url(default: {0}): ', "ws://localhost:62342/chathub")
username = input_with_default('Enter your username (default: {0}): ', "mandrewcito")
# password = input_with_default('Enter your password (default: {0}): ', "Abc123.--123?")
hub_connection = HubConnection(server_url)
hub_connection.build()
hub_connection.on("ReceiveMessage", print)
hub_connection.start()
message = None
# Do login
while message != "exit()":
message = input(">> ")
if message is not None and message is not "" and message is not "exit()":
hub_connection.send("SendMessage", [username, message])
hub_connection.stop()
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
signalrcore-0.1.1.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for signalrcore-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4e51d5edcf24ab46256e000f9356de7ab3887cbea47da3f08da7f51a0545f8b |
|
MD5 | e2a6a4ff67125327ee5f8ebe57119566 |
|
BLAKE2b-256 | ed091b3e13419a9c0813c88747be81a5d8e566bb0de5038ece16842129ec0d0f |