How could I join an IRC channel in-browser using JS? - javascript

I'm building a decentralised peer-to-peer application that uses WebRTC, and as part of its bootstrapping process I require to get nodes from a dynamic source.
The IRC bootstrapping method that Bitcoin used to employ worked by joining an IRC channel and decoding all the usernames into IP addresses to get bootstrap nodes. While this is not sustainable (and this is why they removed it) it did help get the clients set up automatically.
I understand that Freenode has implemented purely AJAX web chat using qwebirc, is there any way I could join a channel on Freenode by sending these AJAX requests from another domain?

Related

Connecting AWS MQTT via websocket

I am trying to connect a sensor to an AWS MQTT Broker to a database that will send it to a webserver so that it can be easily accessible. Right now the only way people in our lab can have access to our sensor data is through contacting me directly and having me connect to the Node Red dashboard. Would there be any way for everyone to have access to the data via WebSocket, or at least a couple of people?
I've searched for hours on end and have had no success regarding the ease of accessibility.
From what I've researched there is this a java based client called MQTT.Cool that can connect multiple brokers and have data published via WebSocket using JavaScript. However there is literally no data available except the ones provided by the company. So combining it it with my project has not been an easy task.
Also, I've thought about allowing my node red dashboard to be accessed out of my local
ip-address, but due to security reasons it has been recommended not to be done.
AWS IoT provides an SDK that you can use in your browser:
https://github.com/aws/aws-iot-device-sdk-js#browser
You can write a web application and view the contents returned by the database after logging in
If you need to browse in real-time, you can use mqtt.js to subscribe to some topics:
https://www.emqx.com/en/blog/connect-to-mqtt-broker-with-websocket
Or use MQTTX, a client tool, to connect directly to the MQTT broker and subscribe to topic

Cross-Browser Communication

I am designing a website that requires a host and client websites. The host will set something up (a session), and the clients will connect to that host using an ID specific to that session.
I have considered how I will facilitate that communication, and initially I was going to have both the clients and the host periodically query and update a database which holds the current states of all clients and the host to communicate new options and changes - but then I wondered if it is possible, using javascript [or something], for them to connect and communicate directly?
The communication would be very simple messages - single strings to communicate current state and stuff like that.
Im pretty proficient in javascript/html/css, but am happy to learn if there is something that would do a better job of setting this up.
Thanks!
Alex
You could try httprelay.io, requires no additional libraries and can be used for simple http client to client communication.
You're looking for WebRTC, which is the de facto and recommended way of doing peer-to-peer connections through the web with pure Javascript:
WebRTC (Web Real-Time Communication) is an API definition drafted by the World Wide Web Consortium (W3C) that supports browser-to-browser applications for voice calling, video chat, and P2P file sharing without the need of either internal or external plugins.
And yes, before you ask, simple messages can be exchanged as well.
Here is the Mozilla reference explaining WebRTC.
Here is a nice simple tutorial to get you started with the code.
Here is a peer-to-peer chat room with video capabilities built using pure WebRTC as a demo.
Prior to WebRTC, there was no satisfactory decentralised way of doing this.
As the comments indicate, Websockets would have been the right idea if you were going with a centralised system - they facilitate real-time communication between clients and a central host.
Decentralised systems, however, must be implemented using WebRTC - this is the only option on the cards.

How to implement video conferencing feature inside a website using webRTC?

Recently I was working on a webRTC project that displays media stream in users browser. However this was only on the client side. What if I want to stream this media to other users browser. As I looked around I found that it was possible by connecting to peers and setting up signalling servers (STUN & TURN). I went through all details that was mentioned on one of the articles on html5rocks website.
I am making use of simplewebRTC but that isn't enough I have to set up my own signalling server in order to be actually able to video chat.
My question is what actually is needed in order to implement a live video chat application embedded within website apart from the api provided by webRTC and how do I set up my own signailling server.
signalmaster was built as a signaling server for simplewebrtc and used by talky.io. It's a node application, start it with "node server.js" and then hook up simplewebrtc to the socket.io endpoint provided.
STUN and TURN servers are not signaling servers. They just help with punching a hole through NAT. The most popular option is rfc-5766-turn-server, restund performs quite well too.
You should provide more detail about your project to get a good answer. Are you planning on making only browser to browser calls? SIP calls? These would be a factor in the signalling server you choose. I went with a SIP signalling server (SIPML5.org) and integrated it with an Asterisk server for call control. This also let me integrate my existing corporate telepresence devices into the PBX. If you want to read up on the basics of signalling and on Webrtc in general Muaz Khan has done some very good work on it.
https://github.com/muaz-khan/WebRTC-Experiment/blob/master/Signaling.md

WebRTC Data Channel server to clients UDP communication. Is it currently possible?

Is it possible to use WebRTC Data Channels on Node.js in a way that mimics the functionality of WebSockets except using UDP?
In essence I want to have a server running Node.js with which browser clients can establish a full duplex bi directional UDP connection via JavaScript.
My question is the same as this one from 8 months ago. I repost it because the only answer was :
Yes, in theory you should be able to to do this. However, you'll need a node module that supports WebRTC data channels, so that you can connect to it like any other peer. Unfortunately, scanning through the current modules, I don't see one that implements the data channel.
Any of you know of such a module ? In my search I found some node modules with the words "webrtc" and "datachannel", but they didn't look like what was needed, they looked like they were meant for specific needs.
This project is very active, and seem to undertake the mission of importing the entire WebRTC stack into node.js
There's also this project but it looks pretty inactive.
Would love to know if that was satisfying and if you're doing such a project (as in the question) please link to github :)
We have implemented the exact same thing: a server/client way of using WebRTC. Besides we also implemented data port multiplexing, so that server would only need to expose one data port for all rtcdata channels.
A quick summary of how it is achieved:
We implemented in nodejs, using wrtc library. But the same principal could be applied to other implementations.
The server exposes a control port, so that the client will exchange SDPs with the server for establishing their data channel.
To support data port multiplexing, At the server, we modify both peer's SDK, so that
Client will always connect to the same server ip:data_port
We implement a UDP data proxy inside the server, so that it can be the bridge between the server webrtc engine and the client.
The code is at: https://github.com/noia-network/webrtc-direct

How to build xmpp over web sockets web chat application like gtalk

How to build xmpp over web sockets web chat application like gtalk using javascript+html or asp.net?
ıt accepts file transfer, video conferencing, private or group chatting. Multiple users and servers can communicate with each other.
If you want your chat system to work with google's gtalk, or If you want to create your own chat server and make private system you will need to implement xmpp on javascript,
follow the links that will help you
http://professionalxmpp.com/
https://github.com/maxpowel/jQuery-XMPP-plugin
There are two ways to achieve your goal:
You can build your own chat solution from scratch (build backend solution using XMPP XEPs, etc. and client-side app)
To make it easier for you, you can use a ready backend and SDK provided by some BaaS providers. In such way you can concentrate on building client-side solution and its UI while you already have a ready backend and a set of requests to connect to that backend and use it.
You can try ConnectyCube since it has both chat and video chat. For video chat they have two options: WebRTC peer-to-peer solution and SFU based one.

Categories

Resources