-2

I have been experimenting with JavaScript lately and was wondering if there was a way to send data from one computer to another on the same network. If there is, you do I use it?

  • I believe WebRTC supports peer-to-peer applications. http://www.webrtc.org – Ben Aston May 31 '15 at 20:14
  • You will have to setup a server which can be done in node.js from there you can have your clients communicate over http. – t3dodson May 31 '15 at 20:14
  • See: [Sending emails with Javascript](http://stackoverflow.com/questions/271171/sending-emails-with-javascript) – Yogi May 31 '15 at 20:15

2 Answers2

0

Sure there is, but you need a server for that. You cannot connect directly two computers' browsers over a network:

Computer A ---+
              |
             SERVER
              |
Computer B ---+

The server's task will then be that of passing messages from one client to the other. You'll need PHP or C# (e.G. ASP.NET) for that. This topic is very (very) broad so this must suffice as an answer.

pid
  • 11,182
  • 5
  • 35
  • 58
0

You can go by a simple example of windows to windows communication. Go through the following link.

copy and paste server to server.js and client to index.html.

setup:

install socket.io
install client.io   

link:

<https://www.tutorialspoint.com/socket.io/socket.io_broadcasting.htm>
Ank_247shbm
  • 424
  • 6
  • 17