README.md 2.32 KB
Newer Older
Steve Johnson's avatar
Steve Johnson committed
1 2
#My Stuff Everywhere™ - sdom-ws2bridge repository

Steve Johnson's avatar
Steve Johnson committed
3
This repository contains the websocket bridge server code.  This server allows communications between the shared TV and remote applications and also provides directory services for determining which applications and devices are connected on the same network.
Steve Johnson's avatar
Steve Johnson committed
4

Steve Johnson's avatar
Steve Johnson committed
5
###Server source:
Steve Johnson's avatar
Steve Johnson committed
6 7 8

- ws2bridge.js: Source code for the NodeJS web socket bridge server.

Steve Johnson's avatar
Steve Johnson committed
9
###Server configuration:
Steve Johnson's avatar
Steve Johnson committed
10 11
These files are not kept in the repository but must reside on your server. See mse/samples for template files.

Steve Johnson's avatar
Steve Johnson committed
12
####ws2bridge.config - Server configuration file in JSON format:
Steve Johnson's avatar
Steve Johnson committed
13 14 15 16 17 18 19 20

    {
      "httpPort"        : 1338,
      "filterByAddress" : true,  // enables subnet address matching for connections
      "enableKeepalive" : true,  // enables the keep-alive for better connection states
      "enableSSDP"    : true     // makes server discoverable using SSDP (mse client applications will discover local bridge servers)
    }

Steve Johnson's avatar
Steve Johnson committed
21
####ws2bridge-ssl.config - SSL Server configuration file in JSON format:
Steve Johnson's avatar
Steve Johnson committed
22 23 24 25 26 27 28 29 30

    {
      "httpPort"        : 1339,
      "filterByAddress" : true,  // enables subnet address matching for connections
      "enableKeepalive" : true,  // enables the keep-alive for better connection states
      "enableSSDP"    : false    // SSL version is on a secure server with a well known address - not discoverable)
    }


Steve Johnson's avatar
Steve Johnson committed
31
###Monitor page: (wsroot directory)
Steve Johnson's avatar
Steve Johnson committed
32 33 34 35 36

Shows status of the bridge on the server. Navigate with a browser to yourdomain:1338/monitor.html
- monitor.html - Bridge monitor page.
- monitor.js - Bridge monitor javascript source.

Steve Johnson's avatar
Steve Johnson committed
37
###Installing and running the bridge servers
Steve Johnson's avatar
Steve Johnson committed
38 39 40 41 42
You can use a forever script on your server to keep the bridges running. There is a sample script in the mse repository in the samples folder.

The bridge (non-SSL) running on your server should ideally be only a backup - there should be discoverable bridge(s) located on the same LAN as the remote and shared applications. This could exist in the TV, cable router/proxy, or even implemented on the users mobile device.

Usage examples: (configure in your forever script or run from the command line)
Steve Johnson's avatar
Steve Johnson committed
43

Steve Johnson's avatar
Steve Johnson committed
44 45 46 47 48
    # Standard bridge on port 1338
    /usr/local/bin/node /.../ws2bridge-ssl.js -config /.../ws2bridge.config

    # SSL bridge on port 1339
    /usr/local/bin/node /.../ws2bridge-ssl.js -ssl -config /.../ws2bridge-html5-ssl.config