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
--- lib/http1.js 2010-07-06 07:54:46.000000000 +0000 | |
+++ lib/http.js 2010-07-06 07:53:55.000000000 +0000 | |
@@ -37,7 +37,7 @@ | |
parser.onHeaderField = function (b, start, len) { | |
var slice = b.toString('ascii', start, start+len).toLowerCase(); | |
- if (parser.value) { | |
+ if (parser.value != undefined) { | |
parser.incoming._addHeaderLine(parser.field, parser.value); | |
parser.field = null; |
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
--- ws.js 2010-07-06 07:23:24.000000000 +0000 | |
+++ ws_my.js 2010-07-07 09:33:39.000000000 +0000 | |
@@ -12,16 +12,26 @@ | |
}); | |
} | |
-var sys = require("sys"), | |
- net = require("net"), | |
- headerExpressions = [ | |
- /^GET (\/[^\s]*) HTTP\/1\.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
--- new3.js 2010-07-07 10:07:46.000000000 +0000 | |
+++ ws_my.js 2010-07-07 10:08:53.000000000 +0000 | |
@@ -52,7 +52,10 @@ | |
policy_file = '<cross-domain-policy><allow-access-from domain="*" to-ports="*" /></cross-domain-policy>'; | |
-exports.createServer = function (websocketListener) { | |
+exports.createServer = function (websocketListener, options) { | |
+ if (!options) options = {}; | |
+ if (!options.flashpolicy) options.flashpolicy = policy_file; |
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
#!/bin/sh | |
# | |
# chkconfig: 345 85 15 | |
# description: Mojolicious app init.d script | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
# Source networking configuration. |
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
#!/bin/bash | |
# | |
# around Startup script for the around web application | |
# | |
# chkconfig: 35 85 15 | |
# description: around | |
# pidfile: /var/run/around.pid | |
# Source function library. | |
. /etc/rc.d/init.d/functions |
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/perl | |
# This is HTTP proxy built atop AnyEvent::HTTPD and AnyEvent::HTTP modules. | |
# I used it to solve some problem but after testing realised that it doesn't solve it entirely. | |
# So I removed special logic and leave almost plain proxy. With referer forging however :) | |
# | |
# Test thoroughly before use! | |
use strict; | |
use warnings; |
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
Run server as: | |
./mojo_ev_test.pl daemon --listen http://localhost:4242 --clients 1 | |
Send requests as: | |
perl -Mstrict -MAnyEvent::HTTP -MData::Dumper -e 'my $cv = AnyEvent->condvar; http_post("http://localhost:4242/hitme", "", timeout => 10, persistent => 0, sub { my ($b, $h) = @_; warn Dumper $h; $cv->send() }); $cv->recv;' | |
First request dumps headers fine, consequent requests timeouts. |
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/local/bin/perl | |
use 5.012; | |
BEGIN { $ENV{MOJO_POLL} = 0; }; | |
use Mojolicious::Lite; | |
use AnyEvent::HTTP; | |
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
# From a fresh install of squeeze | |
aptitude install ruby rubygems # Need ruby to use fpm | |
gem1.8 install fpm --no-ri --no-rdoc | |
aptitude install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p385.tar.gz | |
tar -zxvf ruby-1.9.3-p385.tar.gz | |
cd ruby-1.9.3-p385 | |
rm -rf /tmp/ruby193 |
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 files will be fetched to current directory. | |
# dependencies - curl somewhere in $PATH and URI perl library. | |
perl -e 'use URI; my $m3u_url = shift or die "provide hls playlist url"; sub get { my $path = shift; my $rel = URI->new($path)->rel($m3u_url); `curl $path --progress-bar --create-dirs -o $rel` // die "getting $path failed!"; return $rel }; sub parse_pls { my ($file, $abs) = @_; open(my $fh, $file); return map { chomp; URI->new_abs($_, $abs) } grep { $_ !~ /^#/ } <$fh> }; my $file = get $m3u_url; my @urls = parse_pls($file, $m3u_url); my %loop; while (my $url = shift @urls) { die "loop detected!" if $loop{$url}++; my $file = get $url; push @urls, parse_pls($file, $url) if ($file =~ /\.m3u8$/) }' 'http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8' |
OlderNewer