..Received a message from 127.0.0.1:36940: {"type": "fetch"}
.Received a message from 127.0.0.1:36940: {"type": "fetch"}
Received a message from 127.0.0.1:36940: Binary Data<length=4>
thread 'tokio-runtime-worker' panicked at 'Other types of messages are also unsupported!', nym-client/src/sockets/ws.rs:66:18
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: std::panicking::begin_panic
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:400
7: <nym_client::sockets::ws::ClientRequest as core::convert::From<tungstenite::protocol::message::Message>>::from
at nym-client/src/sockets/ws.rs:66
8: <T as core::convert::Into<U>>::into
at /build/rust/src/rustc-1.40.0-src/src/libcore/convert.rs:547
9: nym_client::sockets::ws::handle_connection::{{closure}}
at nym-client/src/sockets/ws.rs:173
10: <std::future::GenFuture<T> as core::future::future::Future>::poll::{{closure}}
at /build/rust/src/rustc-1.40.0-src/src/libstd/future.rs:43
11: std::future::set_task_context
at /build/rust/src/rustc-1.40.0-src/src/libstd/future.rs:79
12: <std::future::GenFuture<T> as core::future::future::Future>::poll
at /build/rust/src/rustc-1.40.0-src/src/libstd/future.rs:43
13: tokio::task::core::Core<T>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/core.rs:128
14: tokio::task::harness::Harness<T,S>::poll::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:120
15: core::ops::function::FnOnce::call_once
at /build/rust/src/rustc-1.40.0-src/src/libcore/ops/function.rs:227
16: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /build/rust/src/rustc-1.40.0-src/src/libstd/panic.rs:317
17: std::panicking::try::do_call
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:287
18: __rust_maybe_catch_panic
19: std::panicking::try
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:265
20: std::panic::catch_unwind
at /build/rust/src/rustc-1.40.0-src/src/libstd/panic.rs:396
21: tokio::task::harness::Harness<T,S>::poll::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:101
22: tokio::loom::std::causal_cell::CausalCell<T>::with_mut
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/loom/std/causal_cell.rs:41
23: tokio::task::harness::Harness<T,S>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:100
24: tokio::task::raw::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/raw.rs:162
25: tokio::task::raw::RawTask::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/raw.rs:113
26: tokio::task::Task<S>::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/mod.rs:371
27: tokio::runtime::thread_pool::worker::GenerationGuard::run_task
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:446
28: tokio::runtime::thread_pool::worker::GenerationGuard::process_available_work
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:304
29: tokio::runtime::thread_pool::worker::GenerationGuard::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:269
30: tokio::runtime::thread_pool::worker::Worker::run::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:158
31: std::thread::local::LocalKey<T>::try_with
at /build/rust/src/rustc-1.40.0-src/src/libstd/thread/local.rs:262
32: std::thread::local::LocalKey<T>::with
at /build/rust/src/rustc-1.40.0-src/src/libstd/thread/local.rs:239
33: tokio::runtime::thread_pool::worker::Worker::run::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:134
34: tokio::runtime::thread_pool::current::set::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/current.rs:47
35: std::thread::local::LocalKey<T>::try_with
at /build/rust/src/rustc-1.40.0-src/src/libstd/thread/local.rs:262
36: std::thread::local::LocalKey<T>::with
at /build/rust/src/rustc-1.40.0-src/src/libstd/thread/local.rs:239
37: tokio::runtime::thread_pool::current::set
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/current.rs:29
38: tokio::runtime::thread_pool::worker::Worker::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:130
39: tokio::runtime::thread_pool::Workers::spawn::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/mod.rs:113
40: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/task.rs:30
41: tokio::task::core::Core<T>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/core.rs:128
42: tokio::task::harness::Harness<T,S>::poll::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:120
43: core::ops::function::FnOnce::call_once
at /build/rust/src/rustc-1.40.0-src/src/libcore/ops/function.rs:227
44: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /build/rust/src/rustc-1.40.0-src/src/libstd/panic.rs:317
45: std::panicking::try::do_call
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:287
46: __rust_maybe_catch_panic
47: std::panicking::try
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:265
48: std::panic::catch_unwind
at /build/rust/src/rustc-1.40.0-src/src/libstd/panic.rs:396
49: tokio::task::harness::Harness<T,S>::poll::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:101
50: tokio::loom::std::causal_cell::CausalCell<T>::with_mut
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/loom/std/causal_cell.rs:41
51: tokio::task::harness::Harness<T,S>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:100
52: tokio::task::raw::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/raw.rs:162
53: tokio::task::raw::RawTask::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/raw.rs:113
54: tokio::task::Task<S>::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/mod.rs:371
55: tokio::runtime::blocking::pool::run_task
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/pool.rs:290
56: tokio::runtime::blocking::pool::Inner::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/pool.rs:206
57: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/pool.rs:186
58: tokio::runtime::context::enter
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/context.rs:72
59: tokio::runtime::handle::Handle::enter
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/handle.rs:33
60: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/pool.rs:185
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'tokio-runtime-worker' panicked at 'Failed to forward request: TrySendError { kind: Disconnected }', src/libcore/result.rs:1165:5
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: std::panicking::continue_panic_fmt
7: rust_begin_unwind
8: core::panicking::panic_fmt
9: core::result::unwrap_failed
10: core::result::Result<T,E>::expect
at /build/rust/src/rustc-1.40.0-src/src/libcore/result.rs:960
11: nym_client::sockets::ws::accept_connection::{{closure}}
at nym-client/src/sockets/ws.rs:232
12: <std::future::GenFuture<T> as core::future::future::Future>::poll::{{closure}}
at /build/rust/src/rustc-1.40.0-src/src/libstd/future.rs:43
13: std::future::set_task_context
at /build/rust/src/rustc-1.40.0-src/src/libstd/future.rs:79
14: <std::future::GenFuture<T> as core::future::future::Future>::poll
at /build/rust/src/rustc-1.40.0-src/src/libstd/future.rs:43
15: tokio::task::core::Core<T>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/core.rs:128
16: tokio::task::harness::Harness<T,S>::poll::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:120
17: core::ops::function::FnOnce::call_once
at /build/rust/src/rustc-1.40.0-src/src/libcore/ops/function.rs:227
18: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /build/rust/src/rustc-1.40.0-src/src/libstd/panic.rs:317
19: std::panicking::try::do_call
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:287
20: __rust_maybe_catch_panic
21: std::panicking::try
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:265
22: std::panic::catch_unwind
at /build/rust/src/rustc-1.40.0-src/src/libstd/panic.rs:396
23: tokio::task::harness::Harness<T,S>::poll::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:101
24: tokio::loom::std::causal_cell::CausalCell<T>::with_mut
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/loom/std/causal_cell.rs:41
25: tokio::task::harness::Harness<T,S>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:100
26: tokio::task::raw::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/raw.rs:162
27: tokio::task::raw::RawTask::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/raw.rs:113
28: tokio::task::Task<S>::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/mod.rs:371
29: tokio::runtime::thread_pool::worker::GenerationGuard::run_task
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:446
30: tokio::runtime::thread_pool::worker::GenerationGuard::process_available_work
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:304
31: tokio::runtime::thread_pool::worker::GenerationGuard::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:269
32: tokio::runtime::thread_pool::worker::Worker::run::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:158
33: std::thread::local::LocalKey<T>::try_with
at /build/rust/src/rustc-1.40.0-src/src/libstd/thread/local.rs:262
34: std::thread::local::LocalKey<T>::with
at /build/rust/src/rustc-1.40.0-src/src/libstd/thread/local.rs:239
35: tokio::runtime::thread_pool::worker::Worker::run::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:134
36: tokio::runtime::thread_pool::current::set::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/current.rs:47
37: std::thread::local::LocalKey<T>::try_with
at /build/rust/src/rustc-1.40.0-src/src/libstd/thread/local.rs:262
38: std::thread::local::LocalKey<T>::with
at /build/rust/src/rustc-1.40.0-src/src/libstd/thread/local.rs:239
39: tokio::runtime::thread_pool::current::set
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/current.rs:29
40: tokio::runtime::thread_pool::worker::Worker::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/worker.rs:130
41: tokio::runtime::thread_pool::Workers::spawn::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/thread_pool/mod.rs:113
42: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/task.rs:30
43: tokio::task::core::Core<T>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/core.rs:128
44: tokio::task::harness::Harness<T,S>::poll::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:120
45: core::ops::function::FnOnce::call_once
at /build/rust/src/rustc-1.40.0-src/src/libcore/ops/function.rs:227
46: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /build/rust/src/rustc-1.40.0-src/src/libstd/panic.rs:317
47: std::panicking::try::do_call
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:287
48: __rust_maybe_catch_panic
49: std::panicking::try
at /build/rust/src/rustc-1.40.0-src/src/libstd/panicking.rs:265
50: std::panic::catch_unwind
at /build/rust/src/rustc-1.40.0-src/src/libstd/panic.rs:396
51: tokio::task::harness::Harness<T,S>::poll::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:101
52: tokio::loom::std::causal_cell::CausalCell<T>::with_mut
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/loom/std/causal_cell.rs:41
53: tokio::task::harness::Harness<T,S>::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/harness.rs:100
54: tokio::task::raw::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/raw.rs:162
55: tokio::task::raw::RawTask::poll
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/raw.rs:113
56: tokio::task::Task<S>::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/task/mod.rs:371
57: tokio::runtime::blocking::pool::run_task
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/pool.rs:290
58: tokio::runtime::blocking::pool::Inner::run
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/pool.rs:206
59: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/pool.rs:186
60: tokio::runtime::context::enter
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/context.rs:72
61: tokio::runtime::handle::Handle::enter
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/handle.rs:33
62: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
at /home/nar/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.2.9/src/runtime/blocking/pool.rs:185
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
...........
import asyncio
import json
import websockets
async def ping():
pong_address = "kauuj71-RPvETjz8FMQugnsNSDJ8033E4lNS_anMFD0="
uri = "ws://127.0.0.1:9001/mix"
async with websockets.connect(uri) as websock:
request_object = {
"type": "ownDetails"
}
await websock.send(json.dumps(request_object))
response = json.loads(await websock.recv())
print("Ping address =", response["address"])
request_object = {
"type": "send",
"message": "ping",
"recipient_address": pong_address
}
await websock.send(json.dumps(request_object))
print("Ping sent:", request_object)
async def pong():
ping_address = "lzdJ2EkCHlPFVLdsBCkW_n6thaql2wImrGMG0gt_EX4="
uri = "ws://127.0.0.1:9002/mix"
async with websockets.connect(uri) as websock:
request_object = {
"type": "ownDetails"
}
await websock.send(json.dumps(request_object))
response = json.loads(await websock.recv())
print("Ping address =", response["address"])
while True:
request_object = {
"type": "fetch"
}
await websock.send(json.dumps(request_object))
print("Pong sent:", request_object)
response = json.loads(await websock.recv())
messages = response["messages"]
print("Pong received messages:", messages)
if not messages:
await asyncio.sleep(0.1)
def main():
asyncio.get_event_loop().run_until_complete(asyncio.gather(
ping(), pong()
))
if __name__ == "__main__":
main()