curl like spdy client tool

1,519 views
Skip to first unread message

ashish gupta

unread,
Aug 27, 2013, 4:56:50 AM8/27/13
to spdy...@googlegroups.com
Hi,

I have written a curl like SPDY client tool. This will support both version 2 & 3. Version 2 is thoroughly tested and is working fine. I am planning to add more features in this tool. Please feel free to use and provide your feedback. I have made it available at

https://github.com/ashish-gupta-/spdy-python

Available options are:-
python scurl.py -h
Usage:
usage: scurl.py [options] {https://10.102.116.64/testsite/file1k.html,https://10.102.116.64/tesiste/file5.html}"
Default spdy version will be 2 and http version will be 1.1


Options:
  -h, --help            show this help message and exit
  -H CUSTHDR, --header=CUSTHDR
                        Provide a custom header which will be sent along with
                        the request i.e. -H 'host:10.102.116.64'
  -2                    provide this option for using spdy version 2
  -3                    provide this option for using spdy version 2
  -A U_AGENT, --user-agent=U_AGENT
                        (HTTP) Specify the User-Agent string to send to the
                        HTTP server
  -F FORM_DATA, --form=FORM_DATA
                        (HTTP) This lets curl emulate a filled-in form in
                        which a user has pressed the submit button. This
                        causes curl to POST data using the Content-Type
                        multipart/form-data according to RFC 2388
  -d URL_FORM_DATA, --data=URL_FORM_DATA
                        (HTTP) Sends the specified data in a POST request to
                        the HTTP server, in the same way that a browser does
                        when a user has filled in an HTML form and presses the
                        submit button. This will cause curl to pass the data
                        to the server using the content-type application/x
                        -www-form-urlencoded
  -L, --location        (HTTP/HTTPS) If the server reports that the requested
                        page has moved to a different location (indicated with
                        a Location: header and a 3XX response code), this
                        option will make scurl redo the request on the new
                        place
  -T PUT_DATA, --upload-file=PUT_DATA
                        This transfers the specified local file to the remote
                        URL using PUT request
  --http-version=HTTP_VER
                        (HTTP) Which HTTP version to use
  -v, --verbose         make lots of noise [default is no verbose]

Regards,
Ashish

Meghraj Choudhary

unread,
Aug 31, 2013, 6:34:08 AM8/31/13
to spdy...@googlegroups.com
great

laila daniel

unread,
Oct 7, 2013, 8:41:51 AM10/7/13
to spdy...@googlegroups.com
Ashish,

Thanks for the spdy client.
Is there any option for disabling ssl?

Best regards
Laila Daniel

ashish gupta

unread,
Oct 8, 2013, 4:50:08 AM10/8/13
to spdy...@googlegroups.com
Hi Laila,

As of now there is no option for disabling ssl. I can provide the option if you want. May i know, why would you like to use SPDY without ssl?

Regards,
Ashish


--
 
---
You received this message because you are subscribed to the Google Groups "spdy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spdy-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

laila daniel

unread,
Oct 8, 2013, 5:45:08 AM10/8/13
to spdy...@googlegroups.com

Thanks for your reply.
I would like to compare the  performance of spdy and http in environments where the clients have limited cpu resources
and the communication link between the server and the client has low data rate.
The header compression in spdy helps here as the payload (the actual data transmitted) is quite small, but encryption introduces additional data.

If you could provide the no-tls option, it would be great
Thank you
Best regards
laila

ashish gupta

unread,
Oct 9, 2013, 8:42:20 AM10/9/13
to spdy...@googlegroups.com
Hi Laila,

I have provided an option (-n) to use no-tls. Let me know if it works for you.

[root@freebsd63-dev ]# python scurl.py -n -v http://10.102.116.65/testsite/file5.html
=========================================================================

[ session starts ]
protocol which will be supported by this client is - spdy/2
ip is  10.102.116.65 port is 80
protocol selected is plain spdy over tcp
[ stream 1: Request headers ] send SYN_STREAM frame <version=2,fin=1,stream-id=1,pri=3>
                               accept:*/*
                               host:10.102.116.65
                               method:GET
                               user-agent:spdy-curl-v1.0
                               url:/testsite/file5.html
                               scheme:HTTP
                               version:HTTP/1.1
[ stream 1: Response headers ] receive SYN_REPLY frame <version=2,fin=0,stream-id=1>
                               date:Wed, 09 Oct 2013 12:31:40 GMT
                               server:Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.7e-p1
                               last-modified:Mon, 28 Nov 2011 12:40:25 GMT
                               etag:"2be441-5-4b2cace880040"
                               accept-ranges:bytes
                               content-length:5
                               content-type:text/html
                               status:200
                               version:HTTP/1.1
[ stream 1: Response data ] received data <fin=1,stream-id=1,length=5>
                               1234
[ session closes ]
send GOAWAY frame <version=2,flags=0,last-good-stream-id=1>
received GOAWAY frame <version=2,flags=0,last-good-stream-id=1>
[ Final status ]
state of all the streams is:  {1: 'close'}

Regards,
Ashish

laila daniel

unread,
Oct 10, 2013, 4:48:42 AM10/10/13
to spdy...@googlegroups.com
Hello Ashish

Thank you very much. No tls option is working for me now.
It would be nice in the verbose mode if it shows timestamps of each event.
I am now using tcpdump to check the timestamps.
Thanks a lot once again

Best regards
laila

ashish gupta

unread,
Oct 15, 2013, 2:25:52 AM10/15/13
to spdy...@googlegroups.com
Hi Laila,

I will try to provide timestamps as soon as possible. Thanks for your feedback.

Regards,
Ashish

ashish gupta

unread,
Nov 8, 2013, 3:39:59 AM11/8/13
to spdy...@googlegroups.com
Hi Laila,

I have checked again and header compression is working fine for me. I am calling the gzip library at :-

https://github.com/ashish-gupta-/spdy-python/blob/master/spdylib/traffic.py#L213

If you are not able to see headers in plain text in your dump then it is compressed.


In your dump 'GET" request tcp packet length is = 167
I think this is the total packet length. as you can see the application layer data length is = 115
difference is = 167-115=52
  (which is tcp header length)

Let me know if you face any issue.

Regards,
Ashish






a.m...@andanzatechnologies.com

unread,
Sep 21, 2015, 4:20:58 PM9/21/15
to spdy-dev
Hello I've been trying to install this tool, but getting the following error at the last step:

gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.3m -c cython/zlib_stream.c -o build/temp.linux-x86_64-3.3/cython/zlib_stream.o
cython/zlib_stream.c:313:18: fatal error: zlib.h: No such file or directory
 #include "zlib.h"

All previous steps were successful.
Any comment/help?
Thanks in advance!

Dale Worley

unread,
Sep 22, 2015, 9:43:07 AM9/22/15
to spdy...@googlegroups.com
Well, zlib.h is a fairly common library for data compression/decompression, so it's probably available in a standard package for your computer.  Probably Googling(TM) for "How do I install zlib on [distribution name]" will get instructions.  Or just give your system's package installer the name "zlib" and see what it does...


--

---
You received this message because you are subscribed to the Google Groups "spdy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spdy-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages