Git Product home page Git Product logo

sse-chat's Introduction

Server-Sent Events Demo App

This is a toy chat app designed to showcase a simple, barebones (and dependecy-free) node.js implementation of an event-stream server with support for Last-Event-ID.

how do I run it?

npm start

It will serve the chat API (consisting of GET / and POST /send) on port 8916 by default.

As of this writing, it is not a standalone server: the node.js app will only serve the API. You are expected to use an HTTP server like nginx to serve the static files inside the 'front' directory, and, if you'd like to, reverse-proxy the API. A sample nginx proxy configuration is provided in the 'nginx' directory because proxying event-streams isn't completely straightforward. You don't have to proxy the node app, though, since it implements CORS on its own.

should I deploy this on my real-world, commercial website?

It was presented in front of an audience including Oleg so it makes some effort at security, preventing buffer overflows, script injections, and refusing to serve more than 1k simultaneous streams. Since it has no dependency, it is safe from npm-based attacks. It is entirely vulnerable to DOS attacks.

It is very fast and memory-efficient, and writes nothing to the filesystem (no logs either).

And no. Why would you? it's a toy for showcasing a technology!

license

MIT

sse-chat's People

Contributors

touffy avatar

Stargazers

伊撒尔 avatar Johan-David Dehi avatar Eugene Metagnostic avatar Laurent Denoue avatar Nicolas Le Roux avatar

Watchers

 avatar James Cloos avatar

Forkers

enjoybacon7

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.