GFW拦截socks5诡异的规则

GFW会拦截socks5明文的包,今天发现一个诡异的现象,就是有些包虽然含有一些敏感词,譬如google.com还是能通过,所以就跟了一下,发现和初始化socks5有关。
初始化socks5连接的时候客户端会发送一个“我能接受何种验证的包”,格式大概为
05 02 00 02
05意思为socks5版本,02支持两种验证格式,后两位就是两种验证格式,所有的验证格式如下

  1. 0x00: No authentication
  2. 0x01: GSSAPI[12]
  3. 0x02: Username/Password[13]
  4. 0x03–0x7F: methods assigned by IANA[14]
  5. 0x80–0xFE: methods reserved for private use

如果支持的验证方式包含GSSAPI,即便最终的交互没有用到这种方式,那么后续正文内容的包就不会被扫描拦截。
也就是如果一旦是
05 03 00 01 02
GFW就休息了。
煞是奇怪。起码最近是这样。所以为了自由一点,所以还是stunnel吧

Runtime error when setting innerHTML in IE8

When I use plupload, I was puzzled by an exception.
It’s simple.
I reproduce it with the critical code.
HTML:

<p id="container"></p>

Javascript:

var a = document.createElement('div');
document.getElementById('container').appendChild(a);
a.innerHTML="222";

In IE8,It throws runtime exception.

I found some same situations, just like to modify a element triggered by itself, but this one seems unreasonable.

Finally, I found out why: the html content models, Each element defined in this specification has a content model: a description of the element’s expected contents. An HTML element must have contents that match the requirements described in the element’s content model.

The link of description http://www.w3.org/TR/2011/WD-html5-20110525/content-models.html

And The content models http://www.w3.org/TR/html-markup/common-models.html

I thought IE has more powerful fault tolerant, may be sometimes.

XBase64

Basics

xbase64 is a fast javascript base64 encoder and decoder;

Is it the fastest?

As far as I know it’s fast enough. Although it depends on far too many variables to enumerate, I wrote a test, the result below is for reference.

Tell me if you know a faster one. Continue reading

Webp-test

Webp-test is a javascript tool to check whether the browser support webp.

Why Webp-test?

WebP is an image format that employs both lossy and lossless compression. The degree of compression is adjustable so a user can choose the trade-off between file size and image quality. WebP typically achieves an average of 39% more compression than JPEG and JPEG 2000, without loss of image quality.
But a few browsers support WebP right now (as of April 2010, Google Chrome 9+ and Opera 11.10 beta), how to use it?
Now you can use webptest to test browser whether it supports.
Continue reading