0

I have a problem with xhr-polling.Xhr have 5 connections limit.When I looking for a solution,I found that example on github.

https://gist.github.com/jmyrland/4639758

There are 2 codes,I am thinking the first code (ex.js) is server,second code is client(ex-test.js) But when I add this line : "require(socket.io-client)" to the client code,I'm getting "require is not defined" error.How can I use require command on client ?

Ps:I installed socket.io-client.

Tolgay Toklar
  • 4,151
  • 8
  • 43
  • 73
  • Is your client a node js application ? – mguimard Aug 14 '13 at 10:08
  • @mguimard yes I am using socket.io with this code – Tolgay Toklar Aug 14 '13 at 10:37
  • I mean : do you run your client code with nodejs or within a browser like firefox or chrome ? – mguimard Aug 14 '13 at 13:19
  • Then your client is **not** a nodejs application. Consequently, you cannot use node's require. You'll need to modify the code taken from the gist (which is a nodejs client application) to use the socket.io library. By the way, you won't be able to call require("http") to modify the http agent max socket value. Have a look at this post http://stackoverflow.com/questions/561046/how-many-concurrent-ajax-xmlhttprequest-requests-are-allowed-in-popular-browse – mguimard Aug 14 '13 at 13:33
  • I read the link.I understood this is a browser limit.What can I do other than that ? – Tolgay Toklar Aug 14 '13 at 15:17

0 Answers0