Chrome Private – webSocketPrivate

WebSocketPrivate is a chrome private feature that allows Chome Apps to directly talks to any service running over TCP. WebSocket is designed with a most important characteristics that Browser should not be able to establish RAW TCP connection using scripts. If you read the webSocket specification from http://dev.w3.org/html5/websockets/ you can clearly understand that.
    “This interface does not allow for raw access to the underlying network. For example, this interface could not be used to implement an IRC client without proxying messages through a custom server.”

Chrome has provided a feature that allows Chrome Apps to create RAW TCP connections using scripts. Chrome provides this feature only for scripts running in privileged domain chrome-extension://. It has two API’s. Keeping security in mind, Chrome permits this feature only for few extensions.

src/chrome/browser/extensions/extension_web_socket_proxy_private_api.h:
    webSocketProxyPrivate.getPassportForTCP
    webSocketProxyPrivate.getURLForTCP 

Google is going to deprecate getPassportForTCP() function in the future and they have introduced a new API named getURLForTCP(). We can learn about the API usage through their test case and chrome checkin log. getURLForTCP() accepts hostname, port number and call back function. We can extract some useful information from two places.

http://svnsearch.org/svnsearch/repos/CHROMIUM/search?view=&branch=&sound=&logMessage=getPassportForTCP
X:\src\chrome\test\data\extensions\api_test\web_socket_proxy_private\background.js

Advertisements
This entry was posted in Chrome, Cr-48 and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s