Giter Club home page Giter Club logo

pywebsocket's Introduction

pywebsocket

The pywebsocket project aims to provide a WebSocket standalone server and a WebSocket extension for Apache HTTP Server, mod_pywebsocket.

This version is no longer maintained. It has been superceded by pywebsocket3 which works with Python 3 in additional to Python 2.

Most existing users should migrate to pywebsocket3.

Support for running as an Apache module has been dropped in pywebsocket3. If you need an Apache WebSocket module, you should look for an alternate solution.

pywebsocket is intended for testing or experimental purposes.

pywebsocket's People

Contributors

bashi avatar canardleteer avatar hiroshige-g avatar jayvdb avatar ricea avatar toyoshim avatar tyoshino avatar yutak avatar yutakahirano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pywebsocket's Issues

Log exceptions propagated to SocketServer

Purpose of code changes on this branch:
Log exceptions propagated to SocketServer.
Without this patch, such exceptions are logged to stderr rather than
the log file.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 27 Nov 2009 at 8:09

Add Standalone Server

Purpose of code changes on this branch:
Add Standalone server that runs mod_pywebsocket.
This way, mod_pywebsocket can be used even when Apache HTTP Server is not 
available.

This version doesn't have WSS support yet. (I'm experimenting with pyOpenSSL 
now).

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 18 Sep 2009 at 7:48

pywebsocket should log a more friendly error

Asked by ap on e-mail, and by bdash on #webkit.

https://bugs.webkit.org/show_bug.cgi?id=32058

pywebsocket shows following log now:
[2009-12-01 22:43:55,992] [WARNING] root: mod_pywebsocket:
web_socket_transfer_data raised exception: Traceback (most recent call 
last):
  File
"/Volumes/Big/WebKit-BuildSlave/leopard-intel-debug-
tests/build/WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py",
line 179, in transfer_data
    transfer_data_(request)
  File "<string>", line 38, in web_socket_transfer_data
  File
"/Volumes/Big/WebKit-BuildSlave/leopard-intel-debug-
tests/build/WebKitTools/pywebsocket/mod_pywebsocket/msgutil.py",
line 52, in send_message
    request.connection.write('\x00' + message.encode('utf-8') + '\xff')
  File "WebKitTools/pywebsocket/mod_pywebsocket/standalone.py", line 
118, in
write
    return self._request_handler.wfile.write(data)
  File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python
2.5/socket.py",
line 262, in write
    self.flush()
  File
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python
2.5/socket.py",
line 249, in flush
    self._sock.sendall(buffer)
  File "<string>", line 1, in sendall
error: (32, 'Broken pipe')

the server should log a more friendly error to indicate what happened 
rather than logging a backtrace.

Original issue reported on code.google.com by [email protected] on 2 Dec 2009 at 8:41

can't handle request with query component.

What steps will reproduce the problem?
1. % python ./mod_pywebsocket/standalone.py -p 8880 -d example
2. open websocket to ws://host/echo?

What is the expected output? What do you see instead?

expected: connection established.

actual: WARNING:root:mod_pywebsocket: No handler for: '/echo?'
 and connection failed.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by [email protected] on 19 Nov 2009 at 8:29

Allow users to specify which subdirecoty to scan for handlers to save time.

Purpose of code changes on this branch:
Allow users to specify which subdirecoty to scan for handlers to save time.
This is useful in saving scan time when the handler root directory contains
many non-Web Socket handler files.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 23 Oct 2009 at 10:42

Rename test handlers to be more descriptive

Purpose of code changes on this branch:
Rename test handlers to be more descriptive.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 16 Oct 2009 at 3:30

Add wss support

Purpose of code changes on this branch:

To add wss:// support.


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 7 Sep 2009 at 6:23

Add --command-line-flag style

Purpose of code changes on this branch:
Add --command-line-flag style.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 22 Feb 2010 at 2:11

Test

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


Please use labels and text to provide additional information.

Original issue reported on code.google.com by [email protected] on 26 Aug 2009 at 6:50

Make standalone.py log messages to files

Purpose of code changes on this branch:
Make standalone.py log messages to files for easier debugging and monitoring.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 18 Nov 2009 at 8:18

Replace invalid characters with U+fffd in decoding UTF-8 string

Purpose of code changes on this branch:
Replace invalid characters with U+fffd in decoding UTF-8 string.
The Web Socket protocol section 4.4 specifies that invalid
characters be replaced with U+fffd REPLACEMENT CHARACTER.


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 6 Nov 2009 at 7:41

Increase request queue size to accept more simultaneous connections

Purpose of code changes on this branch:
Increase request queue size to accept more simultaneous connections.
This is requested by https://bugs.webkit.org/show_bug.cgi?id=32299.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 16 Dec 2009 at 9:53

WebSocket new protocol

WebSocket protocol/API has been updated at draft-hixie-
thewebsocketprotocol-76

It is incompatible with old spec/current implementation.

Original issue reported on code.google.com by [email protected] on 4 Mar 2010 at 4:11

Add Dispatcher.add_resource_path_alias

Purpose of code changes on this branch:
Add Dispatcher.add_resource_path_alias to make it enable assigning
alias of handler.

This is motivated to have a layout test in webkit to test websocket url
without trailing slash (e.g. ws://127.0.0.1:8880 see
https://bugs.webkit.org/show_bug.cgi?id=33689 ).
We need to have a handler for '/' for the test.


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 19 Jan 2010 at 9:06

Make error log messages friendlier

Purpose of code changes on this branch:
Make error log messages friendlier.
Log high-level summary as WARNING and log stack trace as INFO.

BUG=28

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 3 Dec 2009 at 9:12

Python2.4 Support (CentOS/RHEL)

What steps will reproduce the problem?
1. Installing pywebsocket under CentOS 5.4 yields the following error

{{{
Mod_python error: "PythonHeaderParserHandler 
mod_pywebsocket.headerparserhandler"

Traceback (most recent call last):

  File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 287, 
in HandlerDispatch
    log=debug)

  File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 464, 
in import_module
    module = imp.load_module(mname, f, p, d)

  File "/usr/lib/python2.4/site-
packages/mod_pywebsocket/headerparserhandler.py", line 69, in ?
    _dispatcher = _create_dispatcher()

  File "/usr/lib/python2.4/site-
packages/mod_pywebsocket/headerparserhandler.py", line 55, in 
_create_dispatcher
    _HANDLER_ROOT = apache.main_server.get_options().get(

AttributeError: 'module' object has no attribute 'main_server'
}}}

Was just wondering what version of python the pywebsocket project has 
standardized on and what are the chances of 2.4 support?

Original issue reported on code.google.com by bradleym06 on 3 Feb 2010 at 11:52

only executable file is handled as a CGI script.

Purpose of code changes on this branch:
Check script file is a executable file or not.
Only executable file is handled as a CGI script.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 17 Feb 2010 at 4:10

End echo transaction cleanly

Purpose of code changes on this branch:
End echo transaction cleanly.
This is to address Issue 21 
http://code.google.com/p/pywebsocket/issues/detail?id=21 .

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk


Original issue reported on code.google.com by [email protected] on 12 Nov 2009 at 1:49

Fix style issues in mock.py and test_util.py

Purpose of code changes on this branch:
Fix style issues in mock.py and test_util.py


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 16 Oct 2009 at 1:55

Add wss:// support to standalone server

Purpose of code changes on this branch:
Add wss:// support to the standalone server.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 8 Oct 2009 at 12:15

Fix header skipping logic

Purpose of code changes on this branch:
Fix the erroneous logic for skipping Web Socket headers.
Also fix some stylistic issues.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 15 Oct 2009 at 8:46

Add CGI support in standalone.py

Purpose of code changes on this branch:

Add CGI support in standalone.py.
This is necessary to implement some layout tests for cookie handling.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 29 Jan 2010 at 7:42

Add server_host option.

Purpose of code changes on this branch:
Add server_host option.

Enable to restrict listening interface, e.g. --server_host=127.0.0.1

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk


Original issue reported on code.google.com by [email protected] on 17 Feb 2010 at 5:55

Rename web_socket_shake_hands to make it less confusing.

Purpose of code changes on this branch:
web_socket_shake_hands does not do handshake per se. Rather, it does
additional checking if necessary. Renaming it web_socket_shake_hands_extra
should avoid confusion.


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 15 Oct 2009 at 8:14

Add timeout to echo_client.py

Purpose of code changes on this branch:
Add timeout to echo_client.py

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk


Original issue reported on code.google.com by [email protected] on 30 Oct 2009 at 7:53

Make ws(s) share ports with http(s)

Purpose of code changes on this branch:

Make ws(s) share ports with http(s).
When a request comes in, it is first treated as a Web Socket
request. If Web Socket handshake fails, the request is then
treated as an HTTP request. 

After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 11 Sep 2009 at 9:16

Make strict handshake mode stricter

Purpose of code changes on this branch:
Make strict handshake mode stricter as requested by Issue 35.

BUG: 35

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 5 Jan 2010 at 10:05

Add an option for stricter handshake checking

Purpose of code changes on this branch:
Add an option for stricter handshake checking.

This is related to: https://bugs.webkit.org/show_bug.cgi?id=32249

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 9 Dec 2009 at 6:45

Allow \x20 in subprotocol

Purpose of code changes on this branch:
Allow \x20 in subprotocol.
The Web Socket Protocol has ben changed to allow \x20 (Space) in the 
subprotocol value.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 8 Dec 2009 at 7:46

Add support #!-script on Windows

Purpose of code changes on this branch:
Add support #!-script on Windows.
Primary goal is to run webkit layout tests on Windows (for now, this hack is 
required to run httponly-cookie.pl as cgi script)

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 2 Mar 2010 at 11:47

Address issues in msgutil.py

Purpose of code changes on this branch:
Address issues in msgutil.py, for example, fixing its thread behavior.


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 15 Oct 2009 at 10:56

Fix strict mode

Purpose of code changes on this branch:
Fix strict mode.

It must accept / as resource name in request.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 20 Jan 2010 at 8:42

Handle request with query component

Purpose of code changes on this branch:
Make disptach.py handles request with query component.

BUG=25

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 24 Nov 2009 at 7:36

Warning output from server after client receives message

What steps will reproduce the problem?
1. Run echo server as standalone
2. Connect by using echo client
3.

What is the expected output? What do you see instead?
It shouldn't output anything. Instead it outputs:

WARNING:root:mod_pywebsocket: web_socket_transfer_data raised exception: 
Traceback (most recent call last):
  File "/home/alexander/src/pywebsocket-read-
only/src/mod_pywebsocket/dispatch.py", line 178, in transfer_data
    transfer_data_(request)
  File "<string>", line 40, in web_socket_transfer_data
  File "/usr/lib/python2.6/site-packages/mod_pywebsocket/msgutil.py", line 
67, in receive_message
    frame_type = ord(frame_type_str[0])
IndexError: string index out of range

What version of the product are you using? On what operating system?

r101 on Arch Linux, 64-bit.

Please provide any additional information below.

I also got the same result by using an HTML-file as client. If you want 
more details, check out my blog post: http://www.brevityos.org/blog/?p=243

Original issue reported on code.google.com by [email protected] on 11 Nov 2009 at 9:46

Unable to identify remote ip

What steps will reproduce the problem?
1. print request.connection.remote_ip
2. print request.get_remote_host()

What is the expected output? What do you see instead?
Either 1 or 2 should return me remote ip address.

What version of the product are you using? On what operating system?
On Ubuntu 9.10 -
    1. mod_pywebsocket: web_socket_transfer_data raised exception for 
/register: '_StandaloneConnection' object has no attribute 'remote_ip'

    2. mod_pywebsocket: web_socket_transfer_data raised exception for 
/register: '_StandaloneRequest' object has no attribute 'get_remote_host'


Please provide any additional information below.

pydoc for mod_pywebsocket informs me that -
'''
A Web Socket handler is composed of the following two functions:

        web_socket_do_extra_handshake(request)
        web_socket_transfer_data(request)

    where:
        request: mod_python request.
'''

That request is a mod_python request object, but I am not able to access 1. 
and 2.
I am running in standalone mode. If these properties and methods are not 
available in standalone mode, then what is the other way to access remote 
ip in standalone mode ?

Original issue reported on code.google.com by [email protected] on 27 Dec 2009 at 5:59

Make dispatcher for standalone.py static and shared.

Purpose of code changes on this branch:
Make dispatcher for standalone.py static and shared.
This is to save time for dispatcher creation, which can be long
if there are many files to scan under websock_handlers (scan) directory.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 26 Oct 2009 at 7:17

Fix strict handshake header checking

Purpose of code changes on this branch:
Fix strict handshake header checking. Some rules were too loose.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 16 Dec 2009 at 4:21

Explain how to use the standalone server.

Purpose of code changes on this branch:
Explain how to use the standalone server.

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 7 Oct 2009 at 4:20

Use os.path.realpath instead of os.path.abspath in dispatch.py

Purpose of code changes on this branch:
os.path.abspath doesn't normalize as we wanted if there are symbolic links.
For example, in OSX, /tmp is linked to private/tmp and the start up check
in dispatch.py fails.


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 18 Nov 2009 at 1:21

Fix: dispatcher overlooks handlers if the root directory is specified as a relative path

Purpose of code changes on this branch:
Make the dispatcher find Web Socket handlers even if the root directory
is specified as a relative path. Without this fix, the dispatcher miscalculates
the resource name and overlooks handlers.


When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 6 Oct 2009 at 7:40

Change licensing to BSD-style

Purpose of code changes on this branch:
Change licensing to BSD-style

When reviewing my code changes, please focus on:


After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by [email protected] on 2 Oct 2009 at 12:53

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.