Photo Credit: Kris Krug

How to use telnet to test SPDY and HTTP/2 websites

Matthew Nuzum —  — Leave a comment

I have good news and bad news for you. SPDY is out (also known as HTTP/2), and it’s well supported enough that we’re seeing it in more places. SPDY, pronounced Speedy, is a new web protocol to replace HTTP and promises to make web browsing both faster, safer and more secure.

It’s quite common for web developers and server administrators to need details about what is happening when requests to the server are made. When you use plain HTTP (non SSL or TLS), it’s so easy, you can use any common telnet client. It is possible to use some helper tools to get the same effect to test SSL/TLS based websites.

Sadly, telnet won’t work for SPDY because it is no longer a text-based protocol, but there is a great command line tool that is easily installed that will help you get all the details you need about your connection.

Start by installing spdylay, which is a suite of tools for testing SPDY. It includes spdycat which is our replacement for telnet, spdyd, a basic SPDY server, and shrpx, a proxy.

If you are using a Mac and have homebrew, simply run brew install spdylay. For other systems, check the README. It’s pretty easy on Unix-like systems.

When you want to fetch a page using SPDY, simply use spdycat url. The page will appear in your terminal. SPDY allows multiple resources to be sent through the same connection, so you can download them all with spdy -a url.

Most likely you’re less interested in the HTML contents of the page and instead want to see the server headers. This is a little different than you’re used to, but you can use spdy -nv url to get what you want. The -n means to not show the page. The -v means to show verbose details.

The next question you’ll ask is how to make GET and POST requests. That is a lot harder and I’ll direct you to a far-more detailed post on the subject. It can be done, but you probably don’t want to do it.

Since most sites that support SPDY also support HTTP/1.1, you can just make a request using either telnet or openssl and talk to the server using standard HTTP. Use spdycat in order to check that your SPDY protocol is working as expected.

If it helped, please share!Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

Matthew Nuzum

Posts Twitter Facebook

Web guy, big thinker, loves to talk and write. Front end web, mobile and UX developer for John Deere ISG. My projects: @dsmwebgeeks @tekrs @squaretap ✝