Skip to content

Commit 8a53408

Browse files
committed
use node echo server instead of autobahntestsuite
1 parent 9e1cb03 commit 8a53408

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
language: python
1+
language: node_js
22

33
env:
44
global:
@@ -27,7 +27,6 @@ before_install:
2727
- cd $TRAVIS_BUILD_DIR
2828

2929
install:
30-
- sudo pip install autobahntestsuite
3130
- sudo apt-get install libev-dev
3231
- git clone http://github.com/brimworks/lua-ev
3332
- cd lua-ev && sudo luarocks make rockspec/lua-ev-scm-1.rockspec && cd ..

Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM ubuntu:14.04
22
# 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
74
# install lua
85
ENV LUAROCKS_VERSION=2.0.13
96
ENV LUAROCKS_BASE=luarocks-$LUAROCKS_VERSION
@@ -18,7 +15,13 @@ ENV LUA_INCDIR /usr/include/luajit-2.0
1815
# - LUA=luajit LUA_DEV=libluajit-5.1-dev LUA_VER=5.1 LUA_SFX=jit LUA_INCDIR=/usr/include/luajit-2.0
1916
RUN apt-get install ${LUA} ${LUA_DEV} wget libev-dev git-core unzip -y
2017
RUN lua${LUA_SFX} -v
18+
WORKDIR /
2119
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
2225
RUN tar zxpf $LUAROCKS_BASE.tar.gz
2326
RUN cd $LUAROCKS_BASE && ./configure --lua-version=$LUA_VER --lua-suffix=$LUA_SFX --with-lua-include="$LUA_INCDIR" && make install && cd ..
2427
RUN luarocks --version

echows.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
});

test.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/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} &
45
pid=$!
56
echo "Waiting for wstest to start..."
67
sleep 5

0 commit comments

Comments
 (0)