File tree Expand file tree Collapse file tree 4 files changed +19
-8
lines changed Expand file tree Collapse file tree 4 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 1
- language : python
1
+ language : node_js
2
2
3
3
env :
4
4
global :
@@ -27,7 +27,6 @@ before_install:
27
27
- cd $TRAVIS_BUILD_DIR
28
28
29
29
install :
30
- - sudo pip install autobahntestsuite
31
30
- sudo apt-get install libev-dev
32
31
- git clone http://github.com/brimworks/lua-ev
33
32
- cd lua-ev && sudo luarocks make rockspec/lua-ev-scm-1.rockspec && cd ..
Original file line number Diff line number Diff line change 1
1
FROM ubuntu:14.04
2
2
# install autobahn tests suite (python)
3
- RUN apt-get update -y && apt-get install build-essential libffi-dev libssl-dev python-pip -y
4
- RUN apt-get install python-dev -y
5
- RUN pip -V
6
- RUN pip install autobahntestsuite
3
+ RUN apt-get update -y && apt-get install build-essential libssl-dev python -y
7
4
# install lua
8
5
ENV LUAROCKS_VERSION=2.0.13
9
6
ENV LUAROCKS_BASE=luarocks-$LUAROCKS_VERSION
@@ -18,7 +15,13 @@ ENV LUA_INCDIR /usr/include/luajit-2.0
18
15
# - LUA=luajit LUA_DEV=libluajit-5.1-dev LUA_VER=5.1 LUA_SFX=jit LUA_INCDIR=/usr/include/luajit-2.0
19
16
RUN apt-get install ${LUA} ${LUA_DEV} wget libev-dev git-core unzip -y
20
17
RUN lua${LUA_SFX} -v
18
+ WORKDIR /
21
19
RUN wget --quiet https://github.com/keplerproject/luarocks/archive/v$LUAROCKS_VERSION.tar.gz -O $LUAROCKS_BASE.tar.gz
20
+ RUN wget --quiet https://nodejs.org/dist/latest/node-v4.0.0-linux-x64.tar.gz
21
+ RUN tar xf node-v4.0.0-linux-x64.tar.gz
22
+ ENV PATH /node-v4.0.0-linux-x64/bin:$PATH
23
+ RUN node --version
24
+ RUN npm install -g ws
22
25
RUN tar zxpf $LUAROCKS_BASE.tar.gz
23
26
RUN cd $LUAROCKS_BASE && ./configure --lua-version=$LUA_VER --lua-suffix=$LUA_SFX --with-lua-include="$LUA_INCDIR" && make install && cd ..
24
27
RUN luarocks --version
Original file line number Diff line number Diff line change
1
+ var WebSocketServer = require ( 'ws' ) . Server ;
2
+ var wss = new WebSocketServer ( { port : parseInt ( process . argv [ 2 ] ) } ) ;
3
+
4
+ wss . on ( 'connection' , function connection ( ws ) {
5
+ ws . on ( 'message' , function incoming ( message , flags ) {
6
+ ws . send ( message , flags ) ;
7
+ } ) ;
8
+ } ) ;
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- killall wstest 2> /dev/null
3
- wstest -m echoserver -w ws://localhost:${LUAWS_WSTEST_PORT:= 11000} &
2
+ killall node 2> /dev/null
3
+ npm install ws
4
+ node echows.js ${LUAWS_WSTEST_PORT:= 11000} &
4
5
pid=$!
5
6
echo " Waiting for wstest to start..."
6
7
sleep 5
You can’t perform that action at this time.
0 commit comments