muaz-khan / WebRTC-Experiment

WebRTC, WebRTC and WebRTC. Everything here is all about WebRTC!!
https://www.webrtc-experiment.com/
MIT License
11.76k stars 3.95k forks source link

How can I using Websocket ? #32

Open chichigoodboy opened 11 years ago

chichigoodboy commented 11 years ago

What if I want to use my own WebSocket ?

I don't know how to modify the following code... var socket = new WebSocket('ws://your-websocket-url/');

should I do something in my websocket-url?

xShirase commented 11 years ago

Hi, you should replace 'ws://your-websocket-url/' by the url your server listens on.

Example in my case : 'ws://localhost:8080/''

On Tue, May 28, 2013 at 10:19 AM, chichigoodboy notifications@github.comwrote:

What if I want to use my own WebSocket ?

I don't know how to modify the following code... var socket = new WebSocket('ws://your-websocket-url/');

should I do something in my websocket-url?

— Reply to this email directly or view it on GitHubhttps://github.com/muaz-khan/WebRTC-Experiment/issues/32 .

chichigoodboy commented 11 years ago

but in this example , I replace wss://pubsub.pubnub.com/pub-c-43a717c8-5815-4a7a-b118-19cd690fe879/sub-c-a0cf38de-7263-11e2-8b02-12313f022c90/ to ws://localhost:8080/ and it doesn't working , the console says "Missing Channel"

So , I want to know what I should do in "localhost:8080" , is it echo server or something ?

xShirase commented 11 years ago

You need a websockets server listening on localhost:8080 or any other address you choose. Give me more details, I have a bit of time to help. What do you want to do? What have you done already?

On Tue, May 28, 2013 at 10:47 AM, chichigoodboy notifications@github.comwrote:

but in this example , I replace wss:// pubsub.pubnub.com/pub-c-43a717c8-5815-4a7a-b118-19cd690fe879/sub-c-a0cf38de-7263-11e2-8b02-12313f022c90/ to ws://localhost:8080/ and it doesn't working , the console says "Missing Channel"

So , I want to know what I should do in "localhost:8080" , is it echo server or something ?

— Reply to this email directly or view it on GitHubhttps://github.com/muaz-khan/WebRTC-Experiment/issues/32#issuecomment-18540745 .

chichigoodboy commented 11 years ago

I just want to change websocket to my own. but I have no idea :( . I want to do the the websocket example with my own Websocket , this is what I want to do .

xShirase commented 11 years ago

First, you need to learn how to setup a websockets server. Try this link : http://net.tutsplus.com/tutorials/javascript-ajax/start-using-html5-websockets-today/

On Tue, May 28, 2013 at 10:58 AM, chichigoodboy notifications@github.comwrote:

I just want to change websocket to my own. but I have no idea :( . I want to do the the websocket example with my own Websocket , this is what I want to do .

— Reply to this email directly or view it on GitHubhttps://github.com/muaz-khan/WebRTC-Experiment/issues/32#issuecomment-18541142 .

chichigoodboy commented 11 years ago

OK, very thanks!!

muaz-khan commented 11 years ago

Hi @chichigoodboy, please read this document to understand WebRTC Experiments signaling concepts because all WebSockets or Socket.io implementations that're not using dynamic channels (i.e. namespaces) will fail to run any experiment. PubNub, Firebase and Pusher all such free services supports dynamic channels feature. You can find socket.io over node.js implementation here. I'll add websockets over node.js soon.