Up tonight, I try to get my branch of node-spdy up and running on my http://eeecomputes.com Linode. I need to get it running so that the spdy-dev mailing list (specifically Mike Belshe) can help troubleshoot my server push woes.
SPDY requires the relatively new NPN (Next Protocol Negotiation) extension to SSL. So, first up, I install the latest openssl:
cd ~/src/Note: I install tarballs in
wget ftp://ftp.openssl.org/snapshot/openssl-SNAP-20110603.tar.gz
tar zxf openssl-SNAP-20110603.tar.gz
cd openssl-SNAP-20110603
$HOME/src
as opposed to $HOME/repos
. I reserve the latter for code under source code management.Note #2: The openssl snapshots are only available for a rolling window of 4 days. In the future, I will check out ftp://ftp.openssl.org/snapshot/ for the most recent snapshot. This is a slight inconvenience, but beats installing CVS.
Next, I configure openssl using the Ubuntu configuration settings that I found worked for 32 and 64 bit:
./Configure shared --prefix=$HOME/local no-idea no-mdc2 no-rc5 zlib enable-tlsext linux-elfI install locally, not wanting to mess up the other stuff I have going on that server. To access, I add the following to my
make depend
make
make install
.bashrc
:# For locally installed binariesNext up, I install node.js. NPN is not in the most recent version of node.js (0.4.8), so I have to install the pre-release from github:
export LD_LIBRARY_PATH=$HOME/local/lib
PATH=$HOME/local/bin:$PATH
PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig
CPATH=$HOME/local/include
export MANPATH=$HOME/local/share/man:/usr/share/man
# For node.js work. For more info, see:
# http://blog.nodejs.org/2011/04/04/development-environment/
for i in $HOME/local/*; do
[ -d $i/bin ] && PATH="${i}/bin:${PATH}"
[ -d $i/sbin ] && PATH="${i}/sbin:${PATH}"
[ -d $i/include ] && CPATH="${i}/include:${CPATH}"
[ -d $i/lib ] && LD_LIBRARY_PATH="${i}/lib:${LD_LIBRARY_PATH}"
[ -d $i/lib/pkgconfig ] && PKG_CONFIG_PATH="${i}/lib/pkgconfig:${PKG_CONFIG_PATH}"
[ -d $i/share/man ] && MANPATH="${i}/share/man:${MANPATH}"
done
cd ~/repos/Then I configure and install node:
git clone https://github.com/joyent/node.git
cd node
./configure --openssl-includes=$HOME/local/include --openssl-libpath=$HOME/local/lib --prefix=$HOME/local/node-v0.5.0-preIt needs to be configured so that it uses the NPN-enabled openssl that I just installed in my
make
make install
~/local
directory. It also needs to be configured to install into a ~/local
sub-directory (which will be picked up by my new .bashrc
paths).I then install npm and the required
connect
and zlibcontext
packages:curl http://npmjs.org/install.sh | shLastly, I clone my node-spdy repository (and checkout the
npm install zlibcontext
npm install connect
push-stream
branch where I have been experimenting with SPDY push streams):git clone git://github.com/eee-c/node-spdy.gitWith that, I can change directory into
git checkout -b push-stream -t origin/push-stream
node-spdy
and fire up the test server:cd node-spdyAnd that is all there is to it.
node ./test/spdy-server.js
TLS NPN Server is running on port : 8081
Day #39
No comments:
Post a Comment