Skip to content

A simple application to test socket.io connectivity

License

Notifications You must be signed in to change notification settings

PedroBuffon/easyio-fork

 
 

Repository files navigation

This is a fork of https://github.com/Juriy/easyio to make it work with docker.

EASYIO

A simple application to test REST and SocketIO connectivity and experiment with node.js deployement models. This is an accompanying app for YouTube series - "Deploying Node" https://www.youtube.com/playlist?list=PLQlWzK5tU-gDyxC1JTpyC2avvJlt3hrIh

Check out the deployed version at https://nanogram.io (NOT WORKING ANYMORE)

API

An application exposes REST and SocketIO APIs

REST API

GET /api/test - dumps request headers as well as remote IP as seen by node.js app (good to test if proxy passes the IP)

GET /api/name - responds with the node name (see command line parameters above)

GET /api/info - responds with app version, reading it from version.txt file or 0 if no file is present, value of __dirname and process.cwd(). Useful to see which version is being served and where is it served from

SocketIO API

For every connected client, an application listens to heartbeat event. Once event is received, server will send back heartbeat event with the same payload as client sent, adding the name of the node that processed event. Useful to test socket.io connectivity as well as roundtrip times.

###########################################

To get it running:

docker run -d -p 8080:8080 --name readyio-fork --restart=unless-stopped pedrobuffon/easyio-fork:latest

or you can run it with a docker compose as well:

version: '3.6'
services:
  easyio-fork:
    container_name: easyio-fork
    image: pedrobuffon/easyio-fork:latest
    restart: unless-stopped
    network_mode: bridge
    ports:
      - 9090:8080
    environment:
      - PUID=1000 #optional
      - PGID=1000 #optional
      - WEB_PORT=8080 #optional
      - WEB_NAME=testname #optional
Environment Variable Example Value Description Default Value
PUID 1000 or name OptionalUser Permission node
PGID 1000 or name OptionalGroup Permission node
WEB_PORT 8080 OptionalApp web port 8080
WEB_NAME default OptionalApp Name default

About

A simple application to test socket.io connectivity

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 49.1%
  • CSS 28.9%
  • HTML 12.1%
  • Dockerfile 5.7%
  • Shell 4.2%