Code Monkey home page Code Monkey logo

experimental-websocket-server's Introduction

Experimental WebSocket Server

An experimental server that utilises HTML5 WebSockets to communicate with multiple clients. Includes a free simple WebSocket Client to communicate with the server!

This server is meant to be hosted on Heroku.

Development

  • This project has two components:
    • The main WebSocket server
    • The supporting WebSocket client
  • The WS server is developed in ES6, is transpiled into JavaScript using Babel, and runs on Node.
  • The client is a simple standalone JS+HTML5+CSS app.

Project anatomy:

  • The WebSocket server's source code is stored in /src and compiled into /app
  • The WebSocket client's code is in /web. That's raw code; no compilation is necessary.
  • This project is meant to be run as a server.

Starting the project:

  1. Run npm install to install project dependencies.
  2. Run npm start to start the server.
  3. The WebSocket server is running quietly on ws://localhost:4000
  4. The WebSocket client can be viewed at http://localhost:3000 or by opening /web/index.html.
  • Note: this meants there are two servers running; the main WS server at port 4000 and a simple web server to serve the client app at port 3000.

Alternatively, there's a developer mode:

  1. npm install
  2. npm run dev
  3. http://localhost:3000
  4. Changes to the WS server's JS code will compiled automatically. Note that this will cause the WS server to restart every time a file is changed.

Deploying on Heroku:

  1. TODO

experimental-websocket-server's People

Contributors

shaunanoordin avatar

Watchers

James Cloos avatar  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.