Giter Site home page Giter Site logo

wsrest's Introduction

WSREST: HTTP framework over websocket

Similar framework I used in production. Goal of this framework is to work with websocket streams and request response model with focus o to get smaller network traffic, and avoid creation new connections. Plus it must allow handling standard HTTP without having to need changing code.

This kind of framework is good where you have services that constantly are talking to each other, but you also have web GUI that can configure or monitor your service using either HTTP or Websocket.

Now as websocket is duplex communication, there is implementation of simple protocol that mimics http request response. In this case req and resp are smaller packets than standard http.

Here example req resp as JSON packets:

Request:
{ 
    uid: "req1",
    m : "GET",  //Method : GET, POST, PUT, DELETE
    r : "/myresource"
}

Response:
{
    uid: "req1",
    m : "GET", 
    r : "/myresource"
    c : 200,  //http status code
    d : {...some json data ...}
}

Going a bit further more today services are event driven, so this is also part of framework. There is simple implementation of pubsub but follows this concepts:

  • events must be handled serial
  • subscribe and unsubscribe must be possible as async operation
  • dynamically subscribe and unsubscribe must be possible, where unsubscribe will not discard any prior published events

wsrest's People

Contributors

emiago avatar

Stargazers

ik5 avatar paper2code - bot avatar

Watchers

 avatar

Forkers

nitincs2006

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.