Code Monkey home page Code Monkey logo

docker-websocket-echo's Introduction

datacoda/websocket-echo

This is a very basic websocket echo server based off the tutorial http://autobahn.ws/python/tutorials/echo/

Usage

The container is setup with an entrypoint that takes the port as the first argument. Bind to the corresponding external point either directly with Docker.

docker run -p 8080:8080 datacoda/websocket-echo 8080

You can also just expose it and use a reverse proxy to do the external access.

docker run -expose 80 datacoda/websocket-echo 80

License

MIT

docker-websocket-echo's People

Contributors

datacoda avatar olivierdeckers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-websocket-echo's Issues

Unhandled Error

At the connection using a simple js client:

2017-03-10 14:06:02+0000 [autobahn.twisted.websocket.WebSocketServerFactory] Unhandled Error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/twisted/python/log.py", line 84, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/usr/local/lib/python2.7/site-packages/twisted/internet/posixbase.py", line 597, in _doReadOrWrite
why = selectable.doRead()
--- ---
File "/usr/local/lib/python2.7/site-packages/twisted/internet/tcp.py", line 1067, in doRead
protocol = self.factory.buildProtocol(self._buildAddr(addr))
File "/usr/local/lib/python2.7/site-packages/twisted/internet/protocol.py", line 135, in buildProtocol
p = self.protocol()
File "/usr/local/lib/python2.7/site-packages/autobahn/websocket/protocol.py", line 665, in init
self.is_closed = txaio.create_future()
File "/usr/local/lib/python2.7/site-packages/txaio/_unframework.py", line 43, in _throw_usage_error
"To use txaio, you must first select a framework "
exceptions.RuntimeError: To use txaio, you must first select a framework with .use_twisted() or .use_asyncio()

docker build fails

The docker build fails. Have you considered starting from the official Python image instead? https://hub.docker.com/_/python/

$ docker build -t echo .
Sending build context to Docker daemon 54.78 kB
Step 0 : FROM stackbrew/ubuntu:saucy
Pulling repository docker.io/stackbrew/ubuntu
195eb90b5349: Download complete 
511136ea3c5a: Download complete 
f127542f0b61: Download complete 
fae16849ebe2: Download complete 
0f4aac48388f: Download complete 
209ea56fda6d: Download complete 
Status: Downloaded newer image for stackbrew/ubuntu:saucy
 ---> 195eb90b5349
Step 1 : MAINTAINER Ted Chen <[email protected]>
 ---> Running in 828c49037f64
 ---> a4168dca5a58
Removing intermediate container 828c49037f64
Step 2 : RUN echo "deb http://archive.ubuntu.com/ubuntu saucy main universe" > /etc/apt/sources.list &&   apt-get update &&   apt-get upgrade -y -o DPkg::Options::=--force-confold
 ---> Running in 29a7dbce722b
Ign http://archive.ubuntu.com saucy InRelease
Ign http://archive.ubuntu.com saucy Release.gpg
Ign http://archive.ubuntu.com saucy Release
Ign http://archive.ubuntu.com saucy/main amd64 Packages/DiffIndex
Ign http://archive.ubuntu.com saucy/universe amd64 Packages/DiffIndex
Err http://archive.ubuntu.com saucy/main amd64 Packages
  404  Not Found [IP: 91.189.91.13 80]
Err http://archive.ubuntu.com saucy/universe amd64 Packages
  404  Not Found [IP: 91.189.91.13 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/saucy/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.13 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/saucy/universe/binary-amd64/Packages  404  Not Found [IP: 91.189.91.13 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.
The command '/bin/sh -c echo "deb http://archive.ubuntu.com/ubuntu saucy main universe" > /etc/apt/sources.list &&   apt-get update &&   apt-get upgrade -y -o DPkg::Options::=--force-confold' returned a non-zero code: 100

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.