├── test ├── fixtures │ ├── big.jpg │ └── server-close.js └── support │ └── doge.jpg ├── examples ├── cluster-nginx │ ├── nginx │ │ ├── Dockerfile │ │ └── nginx.conf │ ├── server │ │ ├── Dockerfile │ │ ├── package.json │ │ ├── public │ │ │ ├── index.html │ │ │ ├── style.css │ │ │ └── main.js │ │ └── index.js │ ├── docker-compose.yml │ └── README.md ├── webpack-build │ ├── support │ │ ├── noop.js │ │ ├── webpack.config.js │ │ └── webpack.config.slim.js │ ├── lib │ │ └── index.js │ ├── index.html │ ├── package.json │ └── README.md ├── cluster-httpd │ ├── httpd │ │ ├── Dockerfile │ │ └── httpd.conf │ ├── server │ │ ├── Dockerfile │ │ ├── package.json │ │ ├── public │ │ │ ├── index.html │ │ │ ├── style.css │ │ │ └── main.js │ │ └── index.js │ ├── docker-compose.yml │ └── README.md ├── cluster-haproxy │ ├── haproxy │ │ ├── Dockerfile │ │ └── haproxy.cfg │ ├── server │ │ ├── Dockerfile │ │ ├── package.json │ │ ├── public │ │ │ ├── index.html │ │ │ ├── style.css │ │ │ └── main.js │ │ └── index.js │ ├── docker-compose.yml │ └── README.md ├── chat │ ├── package.json │ ├── README.md │ ├── public │ │ ├── index.html │ │ ├── style.css │ │ └── main.js │ └── index.js ├── whiteboard │ ├── README.md │ ├── package.json │ ├── index.js │ └── public │ │ ├── index.html │ │ ├── style.css │ │ └── main.js └── webpack-build-server │ ├── support │ └── webpack.config.js │ ├── lib │ └── index.js │ ├── README.md │ └── package.json ├── Makefile ├── .gitignore ├── .github ├── PULL_REQUEST_TEMPLATE.md └── ISSUE_TEMPLATE.md ├── docs ├── README.md ├── emit.md └── API.md ├── .travis.yml ├── LICENSE ├── package.json ├── gulpfile.js ├── lib ├── client.js ├── namespace.js ├── index.js └── socket.js ├── Readme.md └── History.md /test/fixtures/big.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/functions/socket.io/master/test/fixtures/big.jpg -------------------------------------------------------------------------------- /test/support/doge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/functions/socket.io/master/test/support/doge.jpg -------------------------------------------------------------------------------- /examples/cluster-nginx/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM nginx:alpine 3 | COPY nginx.conf /etc/nginx/nginx.conf 4 | -------------------------------------------------------------------------------- /examples/webpack-build/support/noop.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function () { return function () {}; }; 3 | -------------------------------------------------------------------------------- /examples/cluster-httpd/httpd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM httpd:2.4-alpine 2 | COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf 3 | -------------------------------------------------------------------------------- /examples/cluster-haproxy/haproxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM haproxy:1.7-alpine 2 | COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg 3 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | @./node_modules/.bin/gulp test 4 | 5 | test-cov: 6 | @./node_modules/.bin/gulp test-cov 7 | 8 | .PHONY: test 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | lib-cov 3 | *.seed 4 | *.log 5 | *.csv 6 | *.dat 7 | *.out 8 | *.pid 9 | benchmarks/*.png 10 | node_modules 11 | coverage 12 | .idea 13 | dist 14 | -------------------------------------------------------------------------------- /examples/webpack-build/support/webpack.config.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = { 3 | entry: './lib/index.js', 4 | output: { 5 | path: './dist', 6 | filename: 'app.js' 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /examples/webpack-build/lib/index.js: -------------------------------------------------------------------------------- 1 | 2 | var socket = require('socket.io-client')('http://localhost:3000'); 3 | 4 | console.log('init'); 5 | 6 | socket.on('connect', onConnect); 7 | 8 | function onConnect(){ 9 | console.log('connect ' + socket.id); 10 | } 11 | -------------------------------------------------------------------------------- /examples/webpack-build/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |