Coder Social home page Coder Social logo

zwssock's Introduction

ZWSSock - ZeroMQ over WebSocket library

ZWSSock implements ZWS (ZeroMQ WebSocket) for use in ZeroMQ applications. Additionally it supports Compression Extensions for WebSocket for per message deflate.

ZWS and ZWSSock are both in early stage and the protocol is not yet finalized nor is this library. The API of ZWSSock is very similar to the API of zsock of CZMQ v3.0, so using it should be very simple. While ZWSSock implements the server side of ZWS JSMQ library implement ZWS on the browser side. JSMQ is javascript library which implements the ZWS protocol and exposes ZeroMQ like API. More information is available via the JSMQ repository.

With JSMQ and ZWSSock, javascript applications can talk directly to ZeroMQ applications without a webserver in the middle, however if you want to use SSL (e.g wss://someaddress) you will need a webserver or loadbalaner in the middle to terminate SSL because ZWSSock does not support SSL.

Please note that when using WebSocket it is recommended to do it over SSL because not all firewalls likes non-text protocols over port 80.

ZWSSock currently implements the router pattern. Publisher pattern is next to come (JSMQ implements subscriber and dealer).

To use the ZWSSock take a look at main.c file. The project also includes browser side example.

On Linux please review src/CZMQ-ZWSSock/Makefile - CFLAGS and LIBS assume an installation of pkg-config. The code is tested with ØMQ=4.0.4 czmq=2.2.0. To build:

cd src/CZMQ-ZWSSock
make

This creates the 'zwstest' program in the same directory. By default zwstest will listen on 127.0.0.1:8000. Pass a different listen socket as single argument:

 ./zwstest tcp://0.0.0.0:1234

zwssock's People

Contributors

bluca avatar c-rack avatar keent avatar leverate-somech avatar rgbkrk avatar skinkie avatar somdoron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zwssock's Issues

Could not compile with msvc 2013

Error 13 error C2275: 'zmq_pollitem_t' : illegal use of this type as an expression R:\zwssock-master\src\CZMQ-ZWSSock\zwssock.c 435 1 CZMQ-ZWSSock

434: // We always poll all three sockets
435: zmq_pollitem_t pollitems[] = {
436: { self->control, 0, ZMQ_POLLIN, 0 },
437: { self->stream, 0, ZMQ_POLLIN, 0 },
438: { self->data, 0, ZMQ_POLLIN, 0 }
439: };

QA tests voor zwssock

For the ease of development and make the product more durable we would like to have a QA suite.

Suggestions in this issue would be:

  1. Which language should it be written in?
  2. What client implementation for websockets can be used to do some quality testing. For example an implementation that implements extensions, but is also able to disable it.
  3. Do we want to describe explicit code and formatting guidelines?

News?

I try to use zwssock with JSMQ to use ZeroMQ over WebSocket to link JavaScript browser-side app to a c++ backend.

I would like to implement a REQ-REP and a SUB-PUB patterns the first use for client ask some think to backend and get a result just after.
The second SUB-PUB is use to send recurrent update from server to subscribers (JavaScript browser-side app).

Currently I found no way to broadcast message with a topic to all client was connected.
So REQ-REP works (with JSMQ.Dealer) but SUB-PUB does not work...

Do you plan to fully implement ZeroMQ WebSocket RFC in order link any JavaScript browser-side app to any backend?

Could not compile VS2017/Win10

I get these errors trying to build ZWSSOCK in X64/Release config:

Severity Code Description Project File Line Suppression State
Error LNK1120 9 unresolved externals CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\x64\Release\CZMQ-ZWSSock.exe 1
Error LNK2001 unresolved external symbol __imp_zmq_poll CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol __imp_zmq_send CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol __imp_zmq_version CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\main.obj 1
Error LNK2001 unresolved external symbol __imp_zsocket_bind CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol __imp_zsocket_connect CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol __imp_zsocket_new CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol __imp_zsocket_sendmem CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol __imp_zsocket_unbind CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1
Error LNK2001 unresolved external symbol __imp_zthread_fork CZMQ-ZWSSock C:\Users\sam\RubymineProjects\untitled\ZWSSock\src\CZMQ-ZWSSock\zwssock.obj 1

My linker configuration:
C:\czmq\libzmq\bin\x64\Release\v141\static\libzmq.lib
C:\czmq\czmq\bin\x64\Release\v141\dynamic\libczmq.lib
C:\czmq\zlib-1.2.11\contrib\vstudio\vc14\x64\ZlibStatRelease\zlibstat.lib
%(AdditionalDependencies)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.