ianbarber / tlszmq Goto Github PK
View Code? Open in Web Editor NEWExample TLS code over ZeroMQ
Example TLS code over ZeroMQ
Firstly, I have to say that your code really do me a big favour during my recent work. Thanks a lot.
I got a little problem trying to understand some specific sentences in your project----- "socket->send( *request, ZMQ_SNDMORE );", In read_message(...) of the file tlsserver.cpp. In my opinion, the content of "request" is the sender identity(according to the comments), why we have to send it back to the sender? Does it associate with the ssl handshake ?
May be I take it in a wrong way, hope that you can give me some tips to help me understand it right.
Thanks for your time.
Is there a particular rational behind writing the code as a "third party helper" ... not sure what the best term is actually ... instead of transparently wrapping the socket?
From a quick look over the code it seems as though it could be modified easily enough to not require the manual pass in/pass out mechanics, but rather give it the socket and let the tls class do the reading/writing to zmq.
Doing it as a wrapper does lose some flexibility in packet format, but not too much... you'd either have to build the envelope as (ID,Null,Encrypted payload) or prepend/append the payload like (ID, Null, [[arbitary, Null], ...], Encrypted payload). Essentially sacrificing flexibility for code reduction.
As I'm following the code, the input is wrapped in zmq message objects, but it's actually processing it on the basis of a binary stream... that would need to be adjusted for more complicated multipart messages?
I'm not seeing anything to handle message delimiting either ... is it a safe assumption that this code is intended for emulating a stream rather than datagram series, with all the messages being concated together and splitting being purely based on how much of the message has been decoded when you ask if it has data?
What's your thoughts on using an inproc transport for passing data in and out of the tls code?
Something like creating the desired type of ZMQ socket and throwing it off in to a worker thread, then talking to the worker over inproc... the worker takes packets in, strips the envelope, encrypts/decrypts the payload, puts the envelope back on, then passes it off to the socket on other side. Success would likely vary with socket type, ROUTER and PUB/SUB should work well, REQ/REP and PUSH/PULL might not be so good.
Ian - Great work and blog post on on this example - I found it very helpful. I couldn't seem to find a license for the usage of this code. Does one exist? Or would you mind adding a license for the use of tlszmq code or for creating derived works?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.