This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(test1). | |
-export([start/0]). | |
%% Cowboy callbacks | |
-export([init/3, handle/2, terminate/2]). | |
start() -> | |
Port = 8081, | |
application:start(sockjs), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(test2). | |
-export([start/0]). | |
%% Cowboy callbacks | |
-export([init/3, handle/2, terminate/2]). | |
start() -> | |
Port = 8081, | |
application:start(sockjs), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
console.log(" [.] Connecting to localhost:8000"); | |
var conn = net.createConnection(8000, '127.0.0.1'); | |
var data = [ | |
"GET /echo/1/1/websocket HTTP/1.1", | |
"Upgrade: WebSocket", | |
"Connection: Upgrade", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env escript | |
%%! -smp disable +A1 +K true -pz ./ebin -pa deps/cowboy/ebin -input | |
-module(cowboy_http10_bug). | |
-mode(compile). | |
-export([main/1]). | |
%% Cowboy callbacks | |
-export([init/3, handle/2, terminate/2]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import socket | |
log = logging.getLogger('udp_server') | |
def udp_server(host='127.0.0.1', port=1234): | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
console.log(" [.] Connecting to localhost:8000"); | |
var conn = net.createConnection(8000, '127.0.0.1'); | |
var data = [ | |
"GET /echo/1/1/websocket HTTP/1.1", | |
"Upgrade: WebSocket", | |
"Connection: Upgrade", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
console.log(" [.] Connecting to localhost:8000"); | |
var conn = net.createConnection(8000, '127.0.0.1'); | |
var data = [ | |
"GET /echo/1/1/websocket HTTP/1.1", | |
"Upgrade: websocket", | |
"Connection: Upgrade", | |
"Host: localhost", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Very simple queue implementation. Don't use it. Use collections.deque | |
instead. | |
>>> q = Queue() | |
>>> q.push(1) | |
>>> q.push(2) | |
>>> len(q) | |
2 | |
>>> bool(q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 3be0091c6401 src/rabbit_stomp_client_sup.erl | |
--- a/src/rabbit_stomp_client_sup.erl Wed Feb 08 15:53:59 2012 +0000 | |
+++ b/src/rabbit_stomp_client_sup.erl Wed Feb 22 11:52:02 2012 +0000 | |
@@ -18,7 +18,7 @@ | |
-behaviour(supervisor2). | |
-define(MAX_WAIT, 16#ffffffff). | |
--export([start_link/1, start_processor/3, init/1]). | |
+-export([start_link/1, start_processor/5, init/1]). | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
rebar get-deps | |
rebar compile | |
erl -pa ebin deps/*/ebin -s wsbug | |
clean: | |
rm -rf deps ebin |