LearnBoost/socket.io-client — Issue #331: Query string management is messed up
Author: MrJoes
Created: 2011-11-03 17:24:43+00:00
State: open

According to https://github.com/LearnBoost/socket.io-spec, multiplixed connections can have query string arguments:
```
1::/test?my=param
```

It is not the case in current implementation of the socket.io.

For example, following code:

var chat = new io.connect('http://localhost:8001/chat?a=b&c=d'),
ping = new io.connect('http://localhost:8001/ping?d=e&f=g');

Does following:
1. Makes handshake request to the server: GET /socket.io/1/?a=b&c=d&t=1320339991081
2. Sends connection packet for chat without query string parameters: 1::/chat
3. Sends connection packet for ping without query string parameters: 1::/ping

Instead, supposed workflow should be:
1. Makes handshake request to the server: GET /socket.io/1/?t=1320339991081
2. Sends connection packet for chat without query string parameters: 1::/chat?a=b&c=d
3. Sends connection packet for ping without query string parameters: 1::/ping?d=e&f=g

Another test case can look like:
var conn = new io.connect('http://localhost:8001/?foo=bar'),
chat = new io.connect('http://localhost:8001/chat?a=b&c=d'),
ping = new io.connect('http://localhost:8001/ping?d=e&f=g');

and flow should be:
1. Makes handshake request to the server: GET /socket.io/1/?foo=bar&t=1320339991081
2. Sends connection packet for chat without query string parameters: 1::/chat?a=b&c=d
3. Sends connection packet for ping without query string parameters: 1::/ping?d=e&f=g

Effectively, this means that:
1. While protocol supports query string parameters for multiplexed connections it is not being used
2. It stores parameters on socket level instead of storing parameters on connection level
3.1. As a result, first connection attempt will pass parameters
3.2. As a result, any subsequent connection attempts will lose their parameters