Git Product home page Git Product logo

erws_example's Introduction

Example

This example shows how to use Websockets and Erlang Web server using binary Erlang External Term Format. All messages are exchanged between client/server using a binary (end-to-end) [Javascript implementation of the Erlang External Term format] (https://github.com/saleyn/erlb.js).

Getting

$ git clone https://github.com/saleyn/erws_example.git

Building

Initial build:

$ make deps

Successive build:

$ make

Running

$ make run

Open a Web browser (tested with Chrome and Firefox) and point to your server's address, port 40000. The click on the link "Open a websocket demo" and you should see a popup window that looks like this:

Example

Clicking on the 'Ping' hyperlink will initiate a message sent back and forth between client browser and server 10000 times.

The green and purple time-series represent random values sent from the server in the form {TickerX, Value::integer(), Dummy::binary()} where TickerX is either ticker1 or ticker2, Value is a random value used to plot in the corresponding time-series, and the Dummy is dummy payload of size 1Kb.

The red time-series is the messages per secord rate of ticker1 and ticker2 respectively. Yellow time-series is the total inbound messages per second rate, and orange time-series is the messages per second rate of incoming replies to the ping requests initiated by user.

License

Copyright (c) 2013 Serge Aleynikov

See attached LICENSE file

erws_example's People

Contributors

charlesokwuagwu avatar saleyn avatar

Watchers

 avatar

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.