Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions clients/desktop/examples/python-examples/websocket/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
base58 = "*"
websockets = "*"
asyncio = "*"

[requires]
python_version = "3.8"
67 changes: 67 additions & 0 deletions clients/desktop/examples/python-examples/websocket/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "selfAddress"
})


async def send_file():
uri = "ws://localhost:1977"
async with websockets.connect(uri) as websocket:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "selfAddress"
})


async def send_text():
message = "Hello Nym!"

Expand All @@ -28,6 +29,6 @@ async def send_text():

print("waiting to receive a message from the mix network...")
received_message = await websocket.recv()
print("received {} from the mix network!".format(received_message))
print("received '{}' from the mix network".format(received_message))

asyncio.get_event_loop().run_until_complete(send_text())