Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    gevent-websocket 0.3.6

    Download button

    No screenshots available
    Downloads: 392  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jeffrey Gelens | More programs
    BSD License / FREE
    April 24th, 2012, 21:24 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    gevent-websocket description

    Websocket handler for the gevent pywsgi server, a Python network library

    gevent-websocket is a websocket library for the Gevent networking library written and maintained by Jeffrey Gelens. It is licensed under the BSD license.

    Installation

    Install Python 2.4 or newer and gevent and its dependencies. The latest release can be download from here or by cloning the repository.

    Usage

    Native Gevent

    At the moment gevent-websocket has one handler based on the Pywsgi gevent server. Set the handler_class when creating a pywsgi server instance to make use of the Websocket functionality:

    from gevent import pywsgi
    from geventwebsocket.handler import WebSocketHandler

    server = pywsgi.WSGIServer(('127.0.0.1', 8000), websocket_app,
     handler_class=WebSocketHandler)
    server.serve_forever()


    Afterwards write a WSGI application with a 3rd parameter, namely a websocket instance:

    def websocket_app(environ, start_response, ws):
     if ws.path == '/echo':
     message = ws.wait()
     ws.send(message)


    Gunicorn

    Using Gunicorn it is even more easy to start a server. Only the websocket_app from the previous example is required to start the server. Dtart Gunicorn using the following command and worker class:

    gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" gunicorn_websocket:websocket_app


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    websocket library | networking library | websocket handler | Gevent | networking | websocket

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM