Walter Kelt
Walter Kelt

Reputation: 2279

javascript websocket clients

Can a single html page, with embedded javascript, have more then a single websocket client ?? Or is it one socket per javascript thread ? I can't seem to find any documentation on this so I figured I'd ask the group.

Upvotes: 1

Views: 607

Answers (2)

josh3736
josh3736

Reputation: 144842

Yes, there is a limit for Firefox. WebSockets are globally (across all open pages) limited to 200 concurrent connections.

Chrome does not appear to currently have a limit, but they're refactoring the WebSocket code and it looks like they'll be adding a limit of 30 connections per "group", which I assume means 30 connections per Origin.

Upvotes: 2

7zark7
7zark7

Reputation: 10135

Make as many as you need:

var Socket = new WebSocket(url);

Upvotes: 0

Related Questions