Permalink
Browse files

Following default port change in specification.

Adding copyright/licence header to each file.
  • Loading branch information...
1 parent bf50ec7 commit 2afb52681e900959ad025e9e58c7fef92d0233a8 @gimite committed Sep 5, 2009
Showing with 8 additions and 3 deletions.
  1. +5 −3 lib/web_socket.rb
  2. +3 −0 samples/chat_server.rb
View
@@ -1,4 +1,6 @@
-# Ref: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-31
+# Copyright: Hiroshi Ichikawa <http://gimite.net/en/>
+# Lincense: New BSD Lincense
+# Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-31
require "socket"
require "uri"
@@ -60,7 +62,7 @@ def initialize(arg, params = {})
end
@path = (uri.path.empty? ? "/" : uri.path) + (uri.query ? "?" + uri.query : "")
origin = params[:origin] || "http://#{uri.host}"
- @socket = TCPSocket.new(uri.host, uri.port || 81)
+ @socket = TCPSocket.new(uri.host, uri.port || 80)
@socket.write(
"GET #{@path} HTTP/1.1\r\n" +
"Upgrade: WebSocket\r\n" +
@@ -169,7 +171,7 @@ class WebSocketServer
def initialize(uri, params = {})
@uri = uri.is_a?(String) ? URI.parse(uri) : uri
- port = params[:port] || @uri.port || 81
+ port = params[:port] || @uri.port || 80
if params[:host]
@tcp_server = TCPServer.open(params[:host], port)
else
View
@@ -1,3 +1,6 @@
+# Copyright: Hiroshi Ichikawa <http://gimite.net/en/>
+# Lincense: New BSD Lincense
+
require "web_socket"
require "thread"

0 comments on commit 2afb526

Please sign in to comment.