oxen-mq/tests
Jason Rhinelander 57f0ca74da Added support for general (non-SN) communications
The existing code was largely set up for SN-to-SN or client-to-SN
communications, where messages can always get to the right place because
we can always send by pubkey.

This doesn't work when we want general communications with a random
remote address.

This commit overhauls the way loki-mq handles communication in a few
important ways:

- Listening instances no longer pass bind addresses into the
constructor; instead they call `listen_curve()` or `listen_plain()`
before invoking `start()`.

- `listen_curve()` is equivalent to the existing bind support: it
listens on a socket and accepts encrypted handshaked connections from
anyone who already knows the server's public key.

- `listen_plain()` is all new: it sets up a plain text listening socket
over which random clients can connect and talk.  End-points aren't
verified, and it isn't encrypted, but if you don't know who you are
talking to then encryption isn't doing anything anyway.

- Connecting to a remote now connections in CURVE encryption or NULL
(plain-text) encryption based on whether you provide a remote_pubkey.
For CURVE, the connection will fail if the pubkey does not match.

- `ConnectionID` objects are now returned when connecting to a remote
address; this object is then passed in to send/request/etc. to direct
the message.  For SN communication, ConnectionID's can be created
implicitly from SN pubkey strings, so the existing interface of
`lmq.send(pubkey, ...)` will still work in most cases.

- A ConnectionID is now passed to the ConnectSuccess and ConnectFailure
callbacks.  This can be used to uniquely identify which connection
succeeded or failed, and can determine whether the remote is a service
node (`.sn()`) and/or the pubkey (`.pubkey()`).  (Obviously the service
node status is only available when the client can do service node
lookups, and the pubkey() is only non-empty for encrypted connections).
2020-02-28 00:16:43 -04:00
..
Catch2@b3b07215d1 Add initial test suite with some batch job tests 2020-02-06 18:10:26 -04:00
CMakeLists.txt Make string_view a full std::string_view implementation 2020-02-22 21:59:07 -04:00
common.h Fix delayed proxy-scheduled batch jobs 2020-02-11 19:08:19 -04:00
main.cpp Add initial test suite with some batch job tests 2020-02-06 18:10:26 -04:00
test_batch.cpp Added support for general (non-SN) communications 2020-02-28 00:16:43 -04:00
test_commands.cpp Added support for general (non-SN) communications 2020-02-28 00:16:43 -04:00
test_connect.cpp Added support for general (non-SN) communications 2020-02-28 00:16:43 -04:00
test_requests.cpp Added support for general (non-SN) communications 2020-02-28 00:16:43 -04:00
test_string_view.cpp Fixed string_view c++17 compatibility 2020-02-24 22:20:56 -04:00