7

I'm searching a way to communicate between two client in Javascript/HTML5, without using a server-side script. I can't use NodeJs for this.

Is there a way to connect two clients?

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Pyrofoux
  • 224
  • 1
  • 6
  • 1
    Have a look at [WebRTC](http://www.webrtc.org/reference/architecture). – ComFreek Nov 07 '13 at 20:31
  • I'm afraid this is impossible, see [this stackoverflow question](http://stackoverflow.com/questions/4118272/do-websockets-allow-for-p2p-browser-to-browser-communication) – Severin Nov 07 '13 at 20:32
  • @Severin: showing that one method doesn't work doesn't mean nothing will... – dandavis Nov 07 '13 at 20:34
  • Yeah, that's why I linked to a question about **browser communication without a server in between** in general like stated in the first sentence of the question (not the heading). – Severin Nov 07 '13 at 20:38
  • Possible duplicate of [Do websockets allow for p2p (browser to browser) communication?](https://stackoverflow.com/questions/4118272/do-websockets-allow-for-p2p-browser-to-browser-communication) – Donald Duck May 12 '19 at 16:14

1 Answers1

0

What exactly are you trying to do? Can you use dependency injection?

I've had to do some workarounds in the past where I've opened windows or iframes into a target page using a url configured like a GET request, complete with a "?key=value" tacked onto the end. The target page has some vanilla javascript in it that looks for these faux GET requests, parses them, and either performs the requested action (fill out and submit a form or click a button or whatever) or uses the window.postMessage to send the requested information back to the original page.

Thor
  • 198
  • 1
  • 8