1.1.3 • Published 5 years ago

swizi-chat-proxy v1.1.3

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

Swizi chat Proxy Helper

This library is a helper to create a Chat Proxy to allow load-balancing facilities on Swizi Chat Server.

Summary

  1. Installation
  2. Load balancing considerations

Installation

npm i swizi-chat-proxy

or

yarn add swizi-chat-proxy

Load balancing considerations

Swizi Chat Server uses session affinity (or sticky session) to manage load balancing. This method need to embed a http session cookie in socket.io exchange. Unfortunately, if http session are not available from js in a browser application, so cookie must be embedded in the browser and the chat server must on the same address than your application server. To fix this issue, you must use a ChatProxy on your server (the one which exposes your application). This proxy will be call by your ChatClient and this proxy will deal with ChatServer. ChatProxy is included in the library, and below is a example to use it :

import express from 'express'
import ChatProxy from 'ChatProxy'
let app = express()
let server = require('http').Server(app)

ChatProxy(server, 'https://ms-chat.swizi.io')

// Do what you have to do with your server.

server.listen(3000, ()=>{
console.log('Server started !')
})
1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago