<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>daniel.haxx.se &#187; Web</title>
	<atom:link href="http://daniel.haxx.se/blog/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://daniel.haxx.se/blog</link>
	<description>Technology is life</description>
	<lastBuildDate>Sat, 11 Feb 2012 18:53:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Swedish FOSS-magasin</title>
		<link>http://daniel.haxx.se/blog/2011/11/19/swedish-foss-magasin/</link>
		<comments>http://daniel.haxx.se/blog/2011/11/19/swedish-foss-magasin/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 22:24:50 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[foss-magasin]]></category>
		<category><![CDATA[foss-sthlm]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=3404</guid>
		<description><![CDATA[Claes, our friend from foss-sthlm and several Open Source adventures, has just fired off a new initiative: FOSS-Magasin. The site launched for real on the evening November 19th.
Where there&#8217;s no real content on the site yet, Claes has set out a mission for himself and future contributors to create a site with technical content in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://foss-magasin.se/"><img class="alignright size-full wp-image-3410" title="foss-magasin" src="http://daniel.haxx.se/blog/wp-content/uploads/2011/11/foss-magasin.png" alt="foss-magasin" width="198" height="96" /></a>Claes, our friend from <a href="http://www.foss-sthlm.se/">foss-sthlm</a> and several Open Source adventures, has just fired off a new initiative: <a href="http://foss-magasin.se/">FOSS-Magasin</a>. The site launched for real on the evening November 19th.</p>
<p>Where there&#8217;s no real content on the site yet, Claes has set out a mission for himself and future contributors to create a site with technical content <em>in Swedish</em> that we geeks miss. This would be within areas such as FOSS, *nix, networking and more.</p>
<p>Tired of the <a href="http://daniel.haxx.se/blog/2011/11/15/idg-prints-lies-about-rms/">poor state of technical and IT related media</a> in Sweden that always seem to try to capture the really large audience and therefore always dumb down everything to a silly level, this is meant to be directed on more competent and interested readers.</p>
<p>The site is free and Claes is looking around for contributors to help hem get content to publish. I can only urge my Swedish friends to <a href="http://foss-magasin.se/om-foss-magasin/">join up and help it get going</a>, as I think it would be nice to get a proper Swedish tech site. For me, it will be especially interesting for things that actually happen in or otherwise is related to Sweden, as for all the rest I personally have no problems accessing English sites to get the info.</p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2011/11/19/swedish-foss-magasin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My SPDY talk at FSCONS</title>
		<link>http://daniel.haxx.se/blog/2011/11/14/my-spdy-talk-at-fscons/</link>
		<comments>http://daniel.haxx.se/blog/2011/11/14/my-spdy-talk-at-fscons/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 19:11:11 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[FSCONS]]></category>
		<category><![CDATA[SPDY]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=3386</guid>
		<description><![CDATA[The slides from my 45 minute talk at FSCONS are now available to view or download at slideshare:
SPDY
View more presentations from Daniel Stenberg.

]]></description>
			<content:encoded><![CDATA[<p>The slides from my 45 minute talk at FSCONS are now available to view or download at slideshare:</p>
<div style="width:425px" id="__ss_10157962"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/bagder/spdy-10157962" title="SPDY">SPDY</a></strong><object id="__sse10157962" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fscons-2011-spdy-111114130141-phpapp01&#038;stripped_title=spdy-10157962&#038;userName=bagder" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse10157962" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fscons-2011-spdy-111114130141-phpapp01&#038;stripped_title=spdy-10157962&#038;userName=bagder" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/bagder">Daniel Stenberg</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2011/11/14/my-spdy-talk-at-fscons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The cookie RFC 6265</title>
		<link>http://daniel.haxx.se/blog/2011/04/28/the-cookie-rfc-6265/</link>
		<comments>http://daniel.haxx.se/blog/2011/04/28/the-cookie-rfc-6265/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 06:25:09 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[IETF]]></category>
		<category><![CDATA[RFC]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=2319</guid>
		<description><![CDATA[http://www.rfc-editor.org/rfc/rfc6265.txt is out!
Back when I was a HTTP rookie in the late 90s, I once expected that there was this fine RFC document somewhere describing how to do HTTP cookies. I was wrong. A lot of others have missed that document too, both before and after my initial search.
I was wrong in the sense that [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://www.rfc-editor.org/rfc/rfc6265.txt">http://www.rfc-editor.org/rfc/rfc6265.txt</a> is out!</p>
<p style="text-align: justify;">Back when I was a <a href="http://en.wikipedia.org/wiki/Http">HTTP</a> rookie in the late 90s, I once expected that there was this fine <a href="http://en.wikipedia.org/wiki/Request_for_Comments">RFC</a> document somewhere describing how to do HTTP cookies. I was wrong. A lot of others have missed that document too, both before and after my initial search.</p>
<p style="text-align: justify;">I was wrong in the sense that sure there were RFCs for cookies. There were even two of them (<a href="http://curl.haxx.se/rfc/rfc2109.txt">RFC2109</a> and <a href="http://curl.haxx.se/rfc/rfc2965.txt">RFC2965</a>)! The only sad thing was however that both of them were totally pointless as in effect nobody (servers nor clients) implemented cookies like that so they documented idealistic protocols that didn&#8217;t exist in the real world. This sad state has made people fall into cookie problems all the way into modern days when they&#8217;ve implemented services according to those RFCs and then <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=610218">blame their browser for failing</a>.</p>
<p><img class="alignright size-full wp-image-2324" style="margin: 8px;" title="cookie" src="http://daniel.haxx.se/blog/wp-content/uploads/2010/12/cookie.png" alt="cookie" width="128" height="128" /></p>
<p style="text-align: justify;">It turned out that the only document that existed that were being used, was the original <a href="http://curl.haxx.se/rfc/cookie_spec.html">Netscape cookie document</a>. It can&#8217;t even be called a specification because it is so short and is so lacking in details that it leaves large holes open and forces implementors to guess about the missing pieces. A sweet irony in itself is the fact that even Netscape removed the document from their site so the only place to find this document is at <a href="http://web.archive.org/web/20070805052634/http://wp.netscape.com/newsref/std/cookie_spec.html">archive.org</a> or copies like the one I link to above at the <a href="http://curl.haxx.se/">curl.haxx.se</a> site. (For some further and more detailed reading about the history of cookies and a bunch of the flaws in the protocol/design, I recommend Michal Zalewski&#8217;s excellent blog post <a href="http://lcamtuf.blogspot.com/2010/10/http-cookies-or-how-not-to-design.html">HTTP cookies, or how not to design protocols</a>.)</p>
<p style="text-align: justify;">While HTTP was increasing in popularity as a protocol during the 00s and still is, and more and more stuff get done in browsers and everything and everyone are using cookies, the protocol was still not documented anywhere as it was actually used.</p>
<p style="text-align: justify;">Somewhat modeled after the <a href="http://www.ietf.org/dyn/wg/charter/httpbis-charter">httpbis working group</a> (which is working on updating and bugfixing the HTTP 1.1 spec), <a href="http://www.ietf.org/">IETF</a> setup a mailing list named <a href="http://www.ietf.org/dyn/wg/charter/httpstate-charter">httpstate</a> in the <a href="http://www.ietf.org/mail-archive/web/http-state/current/msg00000.html">early 2009</a> to start discussing what problems there are with cookies and all related matters. After lively discussions throughout the year, the working group with the same name as the mailinglist was founded at <a href="http://www.ietf.org/mail-archive/web/http-state/current/msg00321.html">December 11th 2009</a>.</p>
<p style="text-align: justify;">One of the initial sparks to get the httpstate group going came from <a href="http://www.ietf.org/mail-archive/web/http-state/current/msg01262.html">Bill Corry who said this</a> about the start:</p>
<p style="text-align: justify;">
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In late 2008, Jim Manico and I connected to create a specification for</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">HTTPOnly &#8212; we saw the security issues arising from how the browser vendors</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">were implementing HTTPOnly in varying ways[1] due to a lack of a specification</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">and formed an ad-hoc working group to tackle the issue[2].</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">When I approached the IETF about forming a charter for an official working</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">group, I was told that I was &lt;quote&gt; &#8220;wasting my time&#8221; because cookies itself</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">did not have a proper specification, so it didn&#8217;t make sense to work on a spec</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">for HTTPOnly.  Soon after, we pursued reopening the IETF httpstate Working</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Group to tackle the entire cookie spec, not just HTTPOnly.  Eventually Adam</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 228px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Barth would become editor and Jeff Hodges our chair.</div>
<blockquote><p><em>In late 2008, Jim Manico and I connected to create a specification for HTTPOnly &#8212; we saw the security issues arising from how the browser vendors were implementing HTTPOnly in varying ways[1] due to a lack of a specification and formed an ad-hoc working group to tackle the issue[2].</em></p>
<p><em>When I approached the IETF about forming a charter for an official working group, I was told that I was &lt;quote&gt; &#8220;wasting my time&#8221; because cookies itself did not have a proper specification, so it didn&#8217;t make sense to work on a spec for HTTPOnly.  Soon after, we pursued reopening the IETF httpstate Working Group to tackle the entire cookie spec, not just HTTPOnly.  Eventually Adam Barth would become editor and Jeff Hodges our chair.</em></p></blockquote>
<div>Since then Adam Barth has worked fiercely as author of the specification and lots of people have joined in and contributed their views, comments and experiences, and we have over time really nailed down how cookies work in the wild today. The current spec now actually describes how to send and receive cookies, the way it is done by existing browsers and clients. Of course, parts of this new spec say things I don&#8217;t think it should, like how it deals with the <a href="http://daniel.haxx.se/blog/2010/01/20/cookie-order/">order of cookies in headers</a>, but as everything in life we needed to compromise and I seemed to be rather lonely on my side of that &#8220;fence&#8221;.</div>
<p style="text-align: justify;">I must stress that the work has only involved to document how things work today and not to invent or create anything new. <strong>We don&#8217;t fix any of the many known problems with cookies</strong>, but we describe how you write your protocol implementation if you want to interact fine with existing infrastructure.</p>
<p style="text-align: justify;">The new spec explicitly obsoletes the older RFC2965, but doesn&#8217;t obsolete RFC2109. That was done already by RFC2965. (<strong>I updated this paragraph after my initial post.</strong>)</p>
<p style="text-align: justify;">Oh, and yours truly is mentioned in the ending &#8220;acknowledgements&#8221; section. It&#8217;s actually the second RFC I get to be mentioned in, the first being <a href="http://tools.ietf.org/html/rfc5854">RFC5854</a>.</p>
<h2>Future</h2>
<p>I am convinced that I will get reason to get back to the cookie topic soon and describe what is being worked on for the future. Once the existing cookies have been documented, there&#8217;s a desire among people to design something that overcomes the problems with the existing protocol. <a href="http://tools.ietf.org/html/draft-abarth-cake-01">Adam&#8217;s CAKE</a> proposal being one of the attempts and ideas in the pipe.</p>
<p>Another parallel IETF effort is the http-auth mailing list in which lots of discussions around HTTP authentication is being held, and as they often today involve cookies there&#8217;s a lot of talk about them there as well. See for example Timothy D. Morgan&#8217;s document <a href="http://vsecurity.com/download/papers/WeaningTheWebOffOfSessionCookies.pdf">Weaning the Web off of Session Cookies</a>.</p>
<p>I&#8217;ll certainly track the development. And possibly even participate in shaping how this will go. We&#8217;ll see.</p>
<p style="text-align: justify;">(<a href="http://findicons.com/icon/168970/cookie?id=168970">cookie image source</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2011/04/28/the-cookie-rfc-6265/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HTTP transfer compression</title>
		<link>http://daniel.haxx.se/blog/2011/04/18/http-transfer-compression/</link>
		<comments>http://daniel.haxx.se/blog/2011/04/18/http-transfer-compression/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 20:44:22 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[cURL and libcurl]]></category>
		<category><![CDATA[HTTP]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=2736</guid>
		<description><![CDATA[HTTP is a protocol that looks simple in its simplest form and its readability can easily fool you into believing an implementation is straight forward and quickly done.
That&#8217;s not the reality though. HTTP is a very big protocol with lots of corners and twisting mazes that one can get lost in. Even after having been [...]]]></description>
			<content:encoded><![CDATA[<p>HTTP is a protocol that looks simple in its simplest form and its readability can easily fool you into believing an implementation is straight forward and quickly done.</p>
<p>That&#8217;s not the reality though. HTTP is a very big protocol with lots of corners and twisting mazes that one can get lost in. Even after having been the primary author of <a href="http://curl.haxx.se/">curl</a> for 13+ years, there are still lots of HTTP things I don&#8217;t master.</p>
<p>To name an example of an area with little known quirks, there&#8217;s a funny situation when it comes to how HTTP supports and doesn&#8217;t support compression of  data and compression of data in transfer.</p>
<h2>No header compression</h2>
<p>A little flaw in HTTP in regards to compression is that <em>there&#8217;s no way to compress headers</em>, in either direction. No matter what we do, we must send the text as-is and both requests and responses are sometimes very big these days. Especially taken into account how cookies are always inserted in requests if they match. Anyway, this flaw is nothing we can do anything about in HTTP 1.1 so we need to live with it.</p>
<p>On the other side, compression of the response body is supported.</p>
<h2>Compressing data</h2>
<p>Compression of data can be done in two ways: either the actual <em>transfer</em> is compressed or the <em>body data</em> is compressed. The difference is subtle, but when the body data is compressed there&#8217;s really nothing that mandates that the client has to uncompress it for the end user, and if the transfer is compressed the receiver <strong>must</strong> uncompress it in order to deal with the transfer properly.</p>
<p>For reasons that are unknown to me, HTTP clients and servers started out supporting compression only using the Content-Encoding style. It means that the client tells the server what kind of content encodings it supports (using Accept-Encoding:) and the server then sends the response data using one of the supported encodings. The client then decides on its own that if it gets the content in one of the compressed formats that it said it can handle, it will automatically uncompress that on arrival.</p>
<p>The HTTP protocol designers however intended this kind of automatic compression and subsequent uncompress to be done using Transfer-Encoding, as the end result is the completely transparent and the uncompress action is implied and intended by the protocol design. This is done by the client telling the server what transfer encodings it supports with the TE: header and the server adds a Transfer-Encoding: header in the response telling how the transfer is encoded.</p>
<p>HTTP 1.1 introduced a mandatory encoding that all servers can use whenever they feel like it: <a href="http://en.wikipedia.org/wiki/Chunked_transfer_encoding">chunked encoding</a>, so all HTTP 1.1 clients already have to deal with Transfer-Encoding to some degree.</p>
<h2>Surely curl is better than all those other guys, right?</h2>
<p>Not really. Not yet anyway.</p>
<p>curl has a long history of copying its behavior from what the browsers do, in order to allow users to basically script anything imaginable that is HTTP-like with curl. In this vein, we implemented compression support the same way as all the browsers did it: the content encoding style. (I have reason to believe that at least Opera actually supports or used to support compressed Transfer-Encoding.)</p>
<p>Starting now (code pushed to git repo just after the 7.21.5 release), we&#8217;ve taken steps to improve things. We&#8217;re changing gears and we&#8217;re introducing support for asking for and using compressed Transfer-Encoding. This will start out as an optional feature/flag (<a href="http://curl.haxx.se/docs/manpage.html#--tr-encoding">&#8211;tr-encoding</a> / <a href="http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTRANSFERENCODING">CURLOPT_TRANSFER_ENCODING</a>) so that we can start out and see how servers in the wild behave and that we can deal with them properly. Then possibly we can switch the default in the future to always ask for compressed transfers. At least for the command line tool.</p>
<p>We know from the little tests we are aware of, that there are at least one known little problem or shall we call it a little detail to keep on eye at, with introducing compressed Transfer-Encoding. As has been so fine reported several years ago in the opera blog <a href="http://my.opera.com/haavard/blog/2008/10/06/browser-sniffing-gone-wrong-again-cars-com">Browser sniffing gone wrong (again): Cars.com</a>, there are cases where this may cause the server to send data that gets compressed <em>twice</em> (using both Content and Transfer Encoding) and that needs to be taken care of properly by the client.</p>
<p>At the time of  this writing, I&#8217;ve not yet taken care of the double-compress case in the code, but I intend to get on to it within shortly.</p>
<p>I&#8217;m otherwise very interested in hearing what kind of experience people will have from this. What servers and sites will support this as documented and intended?</p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2011/04/18/http-transfer-compression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Today I am Chinese</title>
		<link>http://daniel.haxx.se/blog/2011/02/18/today-i-am-chinese/</link>
		<comments>http://daniel.haxx.se/blog/2011/02/18/today-i-am-chinese/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 13:50:27 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[HTTP]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=2610</guid>
		<description><![CDATA[I&#8217;m going about my merry life and I use google every day.
Today Google decided I&#8217;m in China and redirects me to google.com.hk and it shows me all text in Chinese. It&#8217;s just another proof how silly it is trying to use the IP address to figure out location (or even worse trying to guess language [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://daniel.haxx.se/blog/wp-content/uploads/2011/02/desktop.png"><img class="alignright size-medium wp-image-2611" title="Google thinks I'm Chinese" src="http://daniel.haxx.se/blog/wp-content/uploads/2011/02/desktop-300x268.png" alt="Google thinks I'm Chinese" width="300" height="268" /></a>I&#8217;m going about my merry life and I use google every day.</p>
<p>Today Google decided I&#8217;m in China and redirects me to google.com.hk and it shows me all text in Chinese. It&#8217;s just another proof how silly it is trying to use the IP address to figure out location (or even worse trying to guess language based on IP address).</p>
<p>Click on the image to get it in its full glory.</p>
<p>I haven&#8217;t changed anything locally, but it seems Google has updated (broken) their database somehow.</p>
<p>Just to be perfectly sure my browser isn&#8217;t playing any tricks behind my back, I snooped up the headers sent in the HTTP request and there&#8217;s nothing notable:</p>
<pre>GET /complete/search?output=firefox&amp;client=firefox&amp;hl=en-US&amp;q=rockbox HTTP/1.1
Host: suggestqueries.google.com
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.6.13-1.fc13 Firefox/3.6.13
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Cookie: PREF=ID=dc410 [truncated]</pre>
<p>Luckily, I know about the URL &#8220;google.com/ncr&#8221; (No Country Redirect) so I can still use it, but not through my browser&#8217;s search box&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2011/02/18/today-i-am-chinese/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cookies and Websockets and HTTP headers</title>
		<link>http://daniel.haxx.se/blog/2011/02/01/cookies-and-websockets-and-http-headers/</link>
		<comments>http://daniel.haxx.se/blog/2011/02/01/cookies-and-websockets-and-http-headers/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 21:41:25 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[IETF]]></category>
		<category><![CDATA[OWASP]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[Websockets]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=2545</guid>
		<description><![CDATA[So yesterday we held a little HTTP-related event in Stockholm, arranged by OWASP Sweden. We talked a bit about cookies, websockets and recent HTTP headers.
Below are all the slides from the presentations I, Martin Holst Swende and John Wilanders did. (The entire event was done in Swedish.)
Cookies och Websockets

Martin Holst Swende&#8217;s talk:
WebSockets för applikationstestare

John Wilander&#8217;s slides [...]]]></description>
			<content:encoded><![CDATA[<p>So yesterday we held a little HTTP-related event in Stockholm, arranged by OWASP Sweden. We talked a bit about cookies, websockets and recent HTTP headers.</p>
<p>Below are all the slides from the presentations I, Martin Holst Swende and John Wilanders did. (The entire event was done in Swedish.)</p>
<div id="__ss_6766715" style="width: 425px;"><strong><a title="Cookies och Websockets" href="http://www.slideshare.net/bagder/cookies-och-websockets">Cookies och Websockets</a></strong><br />
<object id="__sse6766715" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=owasp-http-cookies-websockets-110131154306-phpapp02&amp;rel=0&amp;stripped_title=cookies-och-websockets&amp;userName=bagder" /><param name="name" value="__sse6766715" /><param name="allowfullscreen" value="true" /><embed id="__sse6766715" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=owasp-http-cookies-websockets-110131154306-phpapp02&amp;rel=0&amp;stripped_title=cookies-och-websockets&amp;userName=bagder" name="__sse6766715" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p>Martin Holst Swende&#8217;s talk:</p>
<div id="__ss_6790720" style="width: 425px;"><strong><a title="WebSockets för applikationstestare" href="http://www.slideshare.net/holiman/websockets">WebSockets för applikationstestare</a><br />
</strong><object id="__sse6790720" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=websockets-110202130212-phpapp02&amp;rel=0&amp;stripped_title=websockets&amp;userName=holiman" /><param name="name" value="__sse6790720" /><param name="allowfullscreen" value="true" /><embed id="__sse6790720" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=websockets-110202130212-phpapp02&amp;rel=0&amp;stripped_title=websockets&amp;userName=holiman" name="__sse6790720" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<p>John Wilander&#8217;s slides from his talk are here:</p>
<div id="__ss_6772594" style="width: 425px;"><strong><a title="Kommer nya HTTP-headers rädda oss?" href="http://www.slideshare.net/johnwilander/kommer-nya-httpheaders-rdda-oss">Kommer nya HTTP-headers rädda oss?</a><br />
</strong><object id="__sse6772594" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=johnwilander-kommernyahttpheadersrddaoss-110201035330-phpapp02&amp;rel=0&amp;stripped_title=kommer-nya-httpheaders-rdda-oss&amp;userName=johnwilander" /><param name="name" value="__sse6772594" /><param name="allowfullscreen" value="true" /><embed id="__sse6772594" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=johnwilander-kommernyahttpheadersrddaoss-110201035330-phpapp02&amp;rel=0&amp;stripped_title=kommer-nya-httpheaders-rdda-oss&amp;userName=johnwilander" name="__sse6772594" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2011/02/01/cookies-and-websockets-and-http-headers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebSockets now: handshake and masking</title>
		<link>http://daniel.haxx.se/blog/2011/01/04/websockets-now-handshake-and-masking/</link>
		<comments>http://daniel.haxx.se/blog/2011/01/04/websockets-now-handshake-and-masking/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 09:06:43 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Websockets]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=2438</guid>
		<description><![CDATA[In August 2010 I blogged about the WebSockets state at the time. In some aspects nothing has changed, and in some other aspects a lot has changed. There&#8217;s still no WebSockets specification that approaches consensus (remember the 4 weeks plan from July?).
Handshaking this or that way
We&#8217;ve been reading an endless debate through the last couple of [...]]]></description>
			<content:encoded><![CDATA[<p>In August 2010 I <a href="http://daniel.haxx.se/blog/2010/08/06/websockets-right-now/">blogged about the WebSockets state</a> at the time. In some aspects nothing has changed, and in some other aspects a lot has changed. There&#8217;s still no WebSockets specification that approaches consensus (remember the <a href="http://www.ietf.org/mail-archive/web/hybi/current/msg02468.html">4 weeks plan from July</a>?).</p>
<h2>Handshaking this or that way</h2>
<p>We&#8217;ve been reading an endless debate through the last couple of months on how the handshake should be made and how to avoid that stupid intermediaries might get tricked by HTTP-looking websocket traffic. In the midst of that storm, a team of people posted the paper <a href="http://www.adambarth.com/experimental/websocket.pdf">Transparent Proxies: Threat or Menace?</a> which argued that HTTP+Upgrade would be insecure and that CONNECT should be used (<a href="http://ietfreport.isoc.org/idref/draft-abarth-websocket-handshake/">Abarth&#8217;s early draft of the CONNECT handshake</a>).</p>
<p><a href="http://www.ietf.org/mail-archive/web/hybi/current/msg04849.html">CONNECT to the server is not kosher HTTP</a> and is not being appreciated by several people &#8211; CONNECT is meant to get sent to proxies and proxies are explicitly setup to a client.</p>
<p>The idea to use a separate and dedicated port is of course brought up every now and then but is mostly not considered. Most people seem to want this protocol to go over the &#8220;web&#8221; ports 80 and 443 and thus to be able to share the proxy environment used for HTTP.</p>
<p>Currently it seems as if we&#8217;re back to a HTTP+Upgrade handshake.</p>
<h2>Masking the traffic</h2>
<p>A lot of people also questioned the very binary outcome of the Transparet Proxies report mentioned above, and later on it seems the consensus that by &#8220;masking&#8221; WebSocket traffic it should be possible to avoid the risk that stupid intermediaries misinterpret the traffic as HTTP. The masking is currently being discussed to be XOR with a frame-specific key, so that a typical stream will change key multiple times but is still easy for a WebSocket-aware tool (say Wireshark and similar) to &#8220;demask&#8221; on purpose.</p>
<p>The last few weeks have been spent on discussing how the masking is done, if it is to become optional and if the masking should include the framing or not.</p>
<h2>This is an open process</h2>
<p>I&#8217;m not sure I&#8217;ve stressed this properly before: IETF is an open organization. Anyone can join in and share their views and opinions, but of course you need to argue <em>technical</em> merits.</p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2011/01/04/websockets-now-handshake-and-masking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>s/Firefox/Chrome/g</title>
		<link>http://daniel.haxx.se/blog/2010/11/10/s-firefox-chrome-g/</link>
		<comments>http://daniel.haxx.se/blog/2010/11/10/s-firefox-chrome-g/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 21:40:29 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=2142</guid>
		<description><![CDATA[A few weeks ago I decided to give Chrome a good ride on my main machine, a Debian Linux unstable. I use it a lot, every day, and I of course use my browser during a large portion of my time in front of it. I&#8217;m a long time Firefox fan and when I&#8217;ve heard [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2145" title="Google Chrome Ball" src="http://daniel.haxx.se/blog/wp-content/uploads/2010/11/google-chrome-ball.jpg" alt="Google Chrome Ball" width="200" height="195" />A few weeks ago I decided to give Chrome a good ride on my main machine, a Debian Linux unstable. I use it a lot, every day, and I of course use my browser during a large portion of my time in front of it. I&#8217;m a long time Firefox fan and when I&#8217;ve heard and read other people converting I&#8217;ve always thought it&#8217;d be hard for me due to my heavy use of certain plugins, old habits and so on.</p>
<p>(Of course, in Debian lingo the browsers are actually called Chromium and Iceweasel, but I&#8217;ve decided to ignore that fact in this post.)</p>
<p>Here&#8217;s the story on how it went, what&#8217;s good with Chrome and what&#8217;s lacking in comparison to Firefox. As compared on my Linux box here.</p>
<h2>Obvious benefints:</h2>
<ul>
<li>Less wasted window/screen estate. The tabs up in the window title is brilliant.</li>
<li>Faster. It&#8217;s generally faster in almost every aspect, but what&#8217;s most noticeable is when starting it.</li>
<li>Less memory hungy. At times I&#8217;ve found my Firefox installation to spend an annoying amount of my precious RAM (I have 4GB installed) and even though I would expect Chrome&#8217;s a process-per-tab concept to be more expensive memory wise, I&#8217;ve had less such problems with it.</li>
<li>The unified address/search bar, back to how Firefox once had it, is only sensible.</li>
<li>In my Firefox I&#8217;ve had two minor quirks for a while that have annoyed me: 1) when I start to search for something, I get a few seconds &#8220;freeze&#8221; immediately after I&#8217;ve started searching. Like I enter a few letters, waaaaaaait, then I can continue. This is certainly nothing life-threatening or something I can&#8217;t live through but it is annoying. 2) I occasionally get problems with flash video playbacks that the video pause or studder, most often a few seconds into it. Chrome has not given me these quirks.</li>
<li>Mailman! I administrate more than 20 mailing lists on the same host (<a href="http://cool.haxx.se/">cool.haxx.se</a>) using mailman. Each list has i<img class="alignright size-full wp-image-2146" title="Firefox Ball" src="http://daniel.haxx.se/blog/wp-content/uploads/2010/11/firefox-ball-200.jpg" alt="Firefox Ball" width="200" height="193" />ts own URL and its own password. <em>But Firefox just cannot remember them separately!!!</em> These are pages I visit several times each day to ack or reject posts etc. Chrome remembers the passwords excellently for all the individual lists. This makes me a much happier person.</li>
</ul>
<h2>Problems I didn&#8217;t get:</h2>
<ul>
<li>The adblock version for Chrome is as good. I&#8217;m not sure exactly how well they compare but I haven&#8217;t noticed anything that&#8217;s given me reason to get annoyed.</li>
<li>The resizeable text edit areas in Chrome is excellent and removes the need for some of the fancier edit plugins in Firefox.</li>
</ul>
<h2>Things still nicer in Firefox:</h2>
<ul>
<li>I love the plugin to force unknown content-types to still be displayed by the browser. Far too many resources are still done using the wrong one and Chrome&#8217;s only option is to save it locally and then force me to run a local tool to display the file. Sure, it works fine but when I want to do that on many files it gets tedious.</li>
<li>In general Chrome, is a bit worse at handing content it doesn&#8217;t know about. I&#8217;ve managed to fiddle with my <em>/etc/mozpluggerrc</em> so that at least PDFs are now saved instead of saying &#8220;missing plug-in&#8221; but so far I&#8217;ve failed to get evince to display them directly. Even if it still is possible to make it happen, it is certainly a bit quirky to have to manually edit a text file to make it happen&#8230;</li>
</ul>
<h2>Conclusion</h2>
<p>I&#8217;ll be running Chrome here now for a while!</p>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2010/11/10/s-firefox-chrome-g/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Future transports</title>
		<link>http://daniel.haxx.se/blog/2010/11/08/future-transports/</link>
		<comments>http://daniel.haxx.se/blog/2010/11/08/future-transports/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 10:46:19 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[FSCONS]]></category>
		<category><![CDATA[MPTCP]]></category>
		<category><![CDATA[SCTP]]></category>
		<category><![CDATA[SPDY]]></category>
		<category><![CDATA[Websockets]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=2185</guid>
		<description><![CDATA[On Sunday morning during FSCONS 2010, in the room &#8220;Torg 4 South&#8221; I did a 30 minute talk about a few future, potentially coming network protocols for transport. A quick look at the current state, some problems of today and 4 different technologies that have been and are being developed to solve the problem.
I got [...]]]></description>
			<content:encoded><![CDATA[<p>On Sunday morning during <a href="http://fscons.org/">FSCONS</a> 2010, in the room &#8220;Torg 4 South&#8221; I did a 30 minute talk about a few future, potentially coming network protocols for transport. A quick look at the current state, some problems of today and 4 different technologies that have been and are being developed to solve the problem.</p>
<p>I got a fair amount of questions and several persons approached me afterwards to make sure they got a copy of my slides.</p>
<p>The video recording is hopefully going to be made available later on, but until then you can read the slides below and imagine my Swedish  accent talking about these matters!</p>
<div id="__ss_5692778" style="width: 425px;"><strong><a title="Fscons future transports" href="http://www.slideshare.net/bagder/fscons-future-transports">Future transports</a></strong><br />
<object id="__sse5692778" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fscons-future-transports-101107140327-phpapp02&amp;stripped_title=fscons-future-transports&amp;userName=bagder" /><param name="name" value="__sse5692778" /><param name="allowfullscreen" value="true" /><embed id="__sse5692778" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fscons-future-transports-101107140327-phpapp02&amp;stripped_title=fscons-future-transports&amp;userName=bagder" name="__sse5692778" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/bagder">Daniel Stenberg</a>.</div>
<div style="padding:5px 0 12px">You can also download the slides directly as a <a href="http://daniel.haxx.se/media/FSCONS-future-transports.pdf">PDF</a>.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2010/11/08/future-transports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing 2-digit year numbers in cookies</title>
		<link>http://daniel.haxx.se/blog/2010/09/01/testing-2-digit-year-numbers-in-cookies/</link>
		<comments>http://daniel.haxx.se/blog/2010/09/01/testing-2-digit-year-numbers-in-cookies/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 20:45:55 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[cURL and libcurl]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IETF]]></category>

		<guid isPermaLink="false">http://daniel.haxx.se/blog/?p=2014</guid>
		<description><![CDATA[In the current work of the IETF http-state working group, we&#8217;re documenting how cookies work. The question came up how browsers and clients treat years in &#8216;expires&#8217; strings if the year is only specified with two digits. And more precisely, is 69 in the future or in the past?
I decided to figure that out. I [...]]]></description>
			<content:encoded><![CDATA[<p>In the current work of the <a href="https://datatracker.ietf.org/wg/httpstate/charter/">IETF http-state working group</a>, we&#8217;re documenting how cookies work. The question came up how browsers and clients treat years in &#8216;expires&#8217; strings if the year is only specified with two digits. And more precisely, <strong>is 69 in the future or in the past?</strong></p>
<p>I decided to figure that out. I setup a little CGI that can be used to check what your browser thinks:</p>
<blockquote><p><a href="http://daniel.haxx.se/cookie.cgi">http://daniel.haxx.se/cookie.cgi</a></p></blockquote>
<p>It sends a single cookie header that looks like:</p>
<blockquote><p>Set-Cookie: testme=yesyes; expires=Wed Sep  1 22:01:55 69;</p></blockquote>
<p>The CGI script looks like this:</p>
<blockquote>
<pre>print "Content-Type: text/plain\n";
print "Set-Cookie: testme=yesyes; expires=Wed Sep  1 22:01:55 69;\n";
print "\nempty?\n";
print $ENV{'HTTP_COOKIE'};</pre>
</blockquote>
<p>You see that it prints the Cookie: header, so if you reload that URL you should see &#8220;testme=yesyes&#8221; being output if the cookie is still there. <em>If the cookie is still there, your browser of choice treats the date above as a date in the future</em>.</p>
<p>So, what browsers think 69 is in the future and what think 69 is in the past? Feel free to try out more browsers and tell me the results, this is the list we have so far:</p>
<p><strong>Future</strong>:</p>
<p style="padding-left: 30px;">Firefox v3 and v4 (year 2069)<br />
curl (year 2038)<br />
IE 7 (year 2069)<br />
Opera (year 2036)<br />
Konqueror 4.5<br />
Android</p>
<p><strong>Past</strong>:</p>
<p style="padding-left: 30px;">Chrome (both v4 and v5)<br />
Gnome Epiphany-Webkit</p>
<p>Thanks to my friends in #rockbox-community that helped me out!</p>
<p>(this info was originally <a href="http://www.ietf.org/mail-archive/web/http-state/current/msg00941.html">posted to the httpstate mailing list</a>)</p>
<h2>Beyond just &#8220;69&#8243;</h2>
<p>(this section was added after my first post)</p>
<p>After having done the above basic tests, I proceeded and wrote a slightly more involved test that sets 100 cookies in this format:</p>
<blockquote>
<pre>Set-Cookie: test$yy=set; expires=Wed Oct  1 22:01:55 $yy;</pre>
</blockquote>
<p>When the user reloads this page, the page prints all &#8220;test$yy&#8221; cookies that get sent to the server. The results with the various browsers is very interesting. <em>These are the ranges different browsers think are future</em>:</p>
<ul>
<li>Firefox: 21 &#8211; 69 (Safari and Fennec and MicroB on n900) [*]</li>
<li>Chrome: 10 &#8211; 68</li>
<li>Konqueror: 00 &#8211; 99 (and IE3, Links, Netsurf, Voyager)</li>
<li>curl: 10 &#8211; 70</li>
<li>Opera: 41 &#8211; 69 (and Opera Mobile) [*]</li>
<li>IE8: 31 &#8211; 79 (and slimbrowser)</li>
<li>IE4: 61 &#8211; 79 (and IE5, IE6)</li>
<li>Midori: 10 &#8211; 69 (and IBrowse)</li>
<li>w3m: 10 &#8211; 37</li>
<li>AWeb: 10 &#8211; 77</li>
<li>Nokia 6300: [none]</li>
</ul>
<p>[*] = Firefox has a default limit of 50 cookies per host which is the explanation to this funny range. When I changed the config &#8216;network.cookie.maxPerHost&#8217; to 200 instead (thanks to Dan Witte), I got the more sensible and expected range 10 &#8211; 69. Opera has the similar thing, it has a limit of 30 cookies by default which explains the 41-69 limit in this case. It would otherwise get 10-69 as well. (thanks to Stanislaw Adrabinski). I <em>guess</em> that the IE8 range is similarly restricted due to it using a limit of 50 cookies per host and an epoch at 1980.</p>
<p>I couldn&#8217;t help myself from trying to parse what this means. The ranges can roughly be summarized like this:</p>
<p>0-9: mostly in the past<br />
10-20: almost always in the future except Firefox<br />
21-30: even more likely to be in the future except IE8<br />
31-37: everyone but opera thinks this is the future<br />
38-40: now w3m and opera think this is the past<br />
41-68: everyone but w3m thinks this is the future<br />
69: Chrome and w3m say past<br />
70: curl, IE8, Konqueror say future<br />
71-79: IE8 and Konqueror say future, everyone else say past<br />
80-99: Konqueror say future, everyone else say past</p>
<p>How to test a browser near you:</p>
<ol>
<li>goto <a href="http://daniel.haxx.se/cookie2.cgi">http://daniel.haxx.se/cookie2.cgi</a></li>
<li>reload once</li>
<li>the numbers shown on the screen is the year numbers the browsers consider<br />
to be the future as described above</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://daniel.haxx.se/blog/2010/09/01/testing-2-digit-year-numbers-in-cookies/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

