sidorares/crmux — pull request #5 by eliseosoto (2014-04-02 23:55:09+00:00)
Title: Update cachedWsUrls on new socket connection.

There was a bug when you followed these steps:

1. Navigate to http://localhost:9223 (crmux).
2. Copy the link for a tab you wanted to inspect and replace the ws port with crmux port (e.g. http://localhost:9223/devtools/devtools.html?ws=localhost:9223/devtools/page/077286da19eb057420df7520e56e6440).
3. Navigate to http://localhost:9223/json
4. **BUG**: webSocketDebuggerUrl is missing for that tab is missing in the JSON response.

The workaround for that case was to navigate to http://localhost:9223/json before anything else to force a cache update, but that's not very obvious.

This pull request updates cachedWsUrls whenever there's a new socket connection, that way webSocketDebuggerUrl will be cached and returned in the JSON.