Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outreachy: WebRTC+sockjs eventbus client #62

Open
pmlopes opened this issue Mar 31, 2022 · 5 comments
Open

Outreachy: WebRTC+sockjs eventbus client #62

pmlopes opened this issue Mar 31, 2022 · 5 comments

Comments

@pmlopes
Copy link
Member

pmlopes commented Mar 31, 2022

WebRTC eventbus extension to sockjs.

Vert.x already has some simple javascript library to handle all the sockjs event bus. You should attempt to understand the code living here:

https://github.com/vert-x3/vertx-eventbus-bridge-clients/blob/master/javascript/vertx-eventbus.js

  1. The first action to complete is to attempt to understand the gist of this script.
  2. Try to understand how the event bus works
  3. understand the 1-1 message flow
  4. understand the 1-N message flow (publish)
  5. understand the 1-1 message reply
  6. understand the N-1 message (publish reply)

Tasks

Get to know the code by refactoring

As you can see, this code is quite old and not using much of the features JavaScript offers today.

As a code exercise, you should start by refactoring the script to use:

This would make you comfortable with the code.

Research the state of the art

A small research on state of the art is the follow-up task. This task is about learning WebRTC. Read the links:

Try to run the examples and see if you understand what is happening.

Research if there are already some project implementing this?

The third step is to use your favorite search engine and look up for projects already implementing the goals of this project.

You will probably find the following github repository:

If you pick it up from there you will notice that in a way the project is already there. But there's a catch. The code doesn't work with today's vert.x version.

Nevertheless, you will notice that the javascript script is highly based on our original code.

Start by drafting what are the differences and how we can port those to our script.

Backend coding

If you are working based on the knowledge from the previous example, you'll see that you will need some backend code too. Try to understand the code:

https://github.com/tommytee/vertx3-eventbus-webrtc-helper

Once you get the idea it means you will need to create a pull request to: https://github.com/vert-x3/vertx-web but this new handler should be written in java.

Investigate what is missing

The example is old, so it may mean that it doesn't implement signaling. Which means you may need to define a simple signaling support, however, remember that signaling can be easily done with the existing event bus support.

Close the open bits

Write a simple demo application where we can see this working.

@Ako-Njang
Copy link
Contributor

Hello, @pmlopes this looks interesting. I would love to be part of this conversation.

@Ako-Njang
Copy link
Contributor

@pmlopes I have gone through this script. My overall understanding of this script is that it establishes a secure TCP communication between two parties to communicate with each other using TCP sockets. I also noticed it uses sockjs-client to implement this under the hood.

The event bus establishes a TCP socket communication between two parties, listens for messages, subscribes to particular channels to get messages, sends messages, and closes connections. The event bus can be configured with several parameters such as whether to reconnect if a connection closes, maximum reconnect attempts, whether to enable ping, etc.
The event bus also can also change states based on which process is currently taking place (states can be CONNECTING, OPEN, CLOSING, and CLOSED).

Correct me if I am wrong
1-1 message flow is the process of sending a message to a particular address
1-N message flow sending a message to multiple addresses.
1-1 message reply: Replying to a message received with a reply address
N-1 message (publish reply): Multiple handlers subscribed to a particular channel replying to a particular message using the reply address.

@Ako-Njang
Copy link
Contributor

I will start working on refactoring the code and test it with the java server.

@Rakielle
Copy link

Rakielle commented Apr 7, 2022

@pmlopes, I have also gone through the script. I have a question though, are we to open one or more pull requests concerning refactoring?

@sherrif10
Copy link

Hello @pmlopes . Am sharif and will be glad contributing to this project. am intrested in this issue , anyone working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants