Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to set up ruby, eventmachine and spdy to use NPN
# Get development tools installed
sudo yum install -y git cvs zlib-devel
sudo yum groupinstall -y "Development Tools"
# Install RVM
bash < <(curl -s
. .rvm/scripts/rvm
# Compile OpenSSL that has NPN support
mkdir openssl
cd openssl
mkdir openssl-dist
cvs -d co openssl
#or wget; tar xvzf openssl-SNAP-20110425.tar.gz; mv openssl-SNAP-20110425 openssl-src
mv openssl openssl-src
cd openssl-src
./config --prefix=$HOME/openssl/openssl-dist/
make depend
make install
cd ..
# Set up the environment to point to the NPN OpenSSL
cat >> <<EOF
export PATH=$HOME/openssl/openssl-dist/bin/:$PATH
export LD_LIBRARY_PATH=$HOME/openssl/openssl-dist/lib
export PKG_CONFIG_PATH=$HOME/openssl/openssl-dist/lib/pkgconfig
export CPATH=$HOME/openssl/openssl-dist/include
cd ..
# RVM install 1.9.2 pointing it to the custom openssl version
# If you have 1.9.2 installed already remove it first: rvm remove 1.9.2
rvm install 1.9.2 -C --with-openssl-dir=$HOME/openssl/openssl-dist/
rvm use 1.9.2
# Install a handfull of gem deps needed later
gem install rake-compiler rspec bundler bindata ffi-zlib
# Install the NPN enabled event machine
git clone git://
cd eventmachine
git checkout tls-npn
rake gem
gem install pkg/eventmachine-1.0.0.beta.3.gem
cd ..
# Install spdy
git clone git://
cd spdy
git checkout npn
cd examples
ruby npn_spdy_server.rb
# You can now connect to the server on port 8000 using https. Using a browser without
# SPDY support you will see a non-spdy response and with support you will see a spdy
# response.

This comment has been minimized.

Copy link

robotarmy commented Sep 18, 2011

-fPIC needed on ubuntu


This comment has been minimized.

Copy link

TheRook commented Oct 28, 2011

After building on ubuntu 11.10 using:
./config --prefix=$HOME/local/ shared -fPIC
rvm install 1.9.2-p180 -C --with-openssl-dir=$HOME/local

I get the exact same error as the base project every time chrome connects:
[:SPDY, :connection_closed]

It doesn't matter if i use --use-spdy=ssl or --use-spdy=no-ssl

Did chrome change its spdy implementation? Is this project out of date?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.