GithubHelp home page GithubHelp logo

mslosarz / nextrtc-signaling-server Goto Github PK

View Code? Open in Web Editor NEW
186.0 17.0 60.0 413 KB

NextRTC is simple WebRTC signaling server written in java. It provides signal exchange and easy to integrate API

Home Page: http://nextrtc.org

License: MIT License

Java 100.00%
nextrtc webrtc webrtc-signaling webrtc-libraries

nextrtc-signaling-server's Introduction

Everything you need is at http://nextrtc.org/ ;)

What is NextRTC?

NextRTC is a rich java library providing WebRTC signaling server. You can use it as standalone web application, or add it as a tenant to your existing Spring application. It uses WebSocket (JSR 356) to communicate with clients. Front end client to NextRTC is available here.

What is needed to build this library on your own

NextRTC project use Lombok, so please be aware that you have to install Lombok plugin to you IDE.

How to add NextRTC to your project?

NextRTC can be used in two modes Standalone or as a Spring module. Details about frontend client can be found here. Both mode setup is described below.

Code examples

There are 5 project that can interest you:

  • Web chat using Spring (Spring WebSocket)
  • Web chat using Tomcat (via Cargo plugin) without Spring but with websocket JSR-356
  • Web chat using RatPack without Spring with Netty WebSocket implementation
  • Web chat with Spring + SpringWebSocket + Spring Security
  • NextRTC JS Client
  • Sample js application that is used in the all examples

Spring module mode

If you want to use NextRTC as a module of existing Spring based solution you have to add to you pom.xml file following entry:

<dependencies>
    <dependency>
        <groupId>org.nextrtc.signalingserver</groupId>
        <artifactId>nextrtc-signaling-server</artifactId>
        <version>${current-version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-websocket</artifactId>
    </dependency>
</dependencies>

Latest version of NextRTC can be found here.

Then you have to create a config where your endpoint will be defined

@Configuration
@Import(NextRTCConfig.class)
public class MyWebSocketConfigurator implements WebSocketConfigurer {
    @Autowired
    private NextRTCServer server;

    @Override
    public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
        registry.addHandler(customEndpoint(), "/signaling").setAllowedOrigins("*");
    }

    @Bean
    public MyEndpoint customEndpoint() {
        return new MyEndpoint(server);
    }
}

And implement Spring WebSocket handler

public class MyEndpoint extends TextWebSocketHandler {
    private static class SessionWrapper implements Connection {

        private final WebSocketSession session;

        public SessionWrapper(WebSocketSession session) {
            this.session = session;
        }

        @Override
        public String getId() {
            return session.getId();
        }

        @Override
        public boolean isOpen() {
            return session.isOpen();
        }

        @Override
        public void sendObject(Object object) {
            try {
                session.sendMessage(new TextMessage(NextRTCServer.MessageEncoder.encode(object)));
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }

    private final NextRTCServer server;

    @Inject
    MyEndpoint(NextRTCServer server) {
        this.server = server;
    }

    @Override
    public void afterConnectionEstablished(WebSocketSession session) throws Exception {
        server.register(new SessionWrapper(session));
    }

    @Override
    protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
        server.handle(NextRTCServer.MessageDecoder.decode(message.getPayload()), new SessionWrapper(session));
    }

    @Override
    public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
        server.unregister(new SessionWrapper(session), status.getReason());
    }
}

That is all what you need to make NextRTC up and running (from the back-end point of view). You can find working example here.

How to register own signal

In configuration class what you have to do is autowire SignalResolver and MessageSender (this one is required to send message to member).

@Configuration
class Config {
    @Autowired
    private SignalResolver resolver;
    @Autowired
    private MessageSender sender;
}

Then in the same Config file you have to add bean which will add your handler to signal resolver. Handler has to implement interface SignalHandler. This interface has only one method with one parameter. This parameter has type InternalMessage. In parameter of this method you will always have from field with member that sent message. If your client provides in request destination member, field to will be filled with appropriate member.

That interface has only one method, so I this example I'll inline it to lambda expression:

@Configuration
class Config {
    @Bean
    public Signal addCustomNextRTCHandlers(){
        Signal upperCase = Signal.fromString("upperCase");
        resolver.addCustomHandler(upperCase, (msg)-> 
            sender.send(InternalMessage.create()
                    .to(msg.getFrom())
                    .content(msg.getContent().toUpperCase())
                    .signal(upperCase)
                    .build())
        );
        return upperCase;
    }
}

In this example new handler (upperCase) will take a content of incoming message and resend the content to sender with uppercase letters.

How to react on events

If you want to handle event that comes from server you have to create class that implements interface implements NextRTCHandler, and give annotation @NextRTCEventListener(<event>). Class that implements interface and has EventListener annotation has to be registered in Spring container. Here is example with basic handler.

@Component
@NextRTCEventListener(UNEXPECTED_SITUATION)
public class ExceptionHandler implements NextRTCHandler {
    private static final Logger log = Logger.getLogger(ExceptionHandler.class);
    @Override
    public void handleEvent(NextRTCEvent nextRTCEvent) {
        log.error(nextRTCEvent);
    }
}

Standalone mode

If you want to use NextRTC in standalone mode you have to add it as a Maven dependency

<dependencies>
    <dependency>
        <groupId>org.nextrtc.signalingserver</groupId>
        <artifactId>nextrtc-signaling-server</artifactId>
        <version>${current-version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

Latest version of NextRTC can be found here. Then you have to create NextRTCServer instance. And use it inside your WebSocket handler. Below there are examples of usage that can be found here (ratpack) and here (standalone tomcat).

// RatPack implementation
public class RatPackWebSocketHandler implements WebSocketHandler<String> {
    private final NextRTCServer server;
    private RatPackConnection connection;

    private static class RatPackConnection implements Connection {
        private static final AtomicLong nextId = new AtomicLong(1);
        private final WebSocket socket;
        private String id;

        private RatPackConnection(WebSocket socket) {
            this.id = "0xx" + nextId.getAndIncrement();
            this.socket = socket;
        }

        @Override
        public String getId() {
            return id;
        }

        @Override
        public boolean isOpen() {
            return socket.isOpen();
        }

        @Override
        public void sendObject(Object object) {
            socket.send(NextRTCServer.MessageEncoder.encode(object));
        }
    }

    public RatPackWebSocketHandler(NextRTCServer server) {
        this.server = server;
    }

    @Override
    public String onOpen(WebSocket webSocket) throws Exception {
        connection = new RatPackConnection(webSocket);
        server.register(connection);
        return null;
    }

    @Override
    public void onClose(WebSocketClose<String> webSocketClose) throws Exception {
        server.unregister(connection, webSocketClose.getOpenResult());
    }

    @Override
    public void onMessage(WebSocketMessage<String> webSocketMessage) throws Exception {
        server.handle(webSocketMessage.getText(), connection);
    }
}

When you're using tomcat as a servlet container you'll need to add two dependencies (websocket-api and servlet-api)

<dependencies>
    <dependency>
        <groupId>javax.websocket</groupId>
        <artifactId>javax.websocket-api</artifactId>
        <version>1.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.nextrtc.signalingserver</groupId>
        <artifactId>nextrtc-signaling-server</artifactId>
        <version>${current-version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

In standalone mode you probably have to add to your project directory webapp/WEB-INF/web.xml with content is similar to this provided below:

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
		 http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
</web-app>

And implement @ServerEndpoint as it was presented below

@ServerEndpoint(value = "/signaling")
public class MyEndpoint {

    private static final Logger log = LoggerFactory.getLogger(MyEndpoint.class);
    private static final NextRTCServer server = NextRTCServer.create(configuration -> {
        configuration.nextRTCProperties().setPingPeriod(1);

        configuration.signalResolver().addCustomSignal(Signal.fromString("upperCase"), (msg) ->
                configuration.messageSender().send(InternalMessage.create()
                        .to(msg.getFrom())
                        .signal(Signal.fromString("upperCase"))
                        .content(msg.getContent() == null ? "" : msg.getContent().toUpperCase())
                        .build()));

        configuration.eventDispatcher().addListener(new CustomHandler());
        return configuration;
    });

    private static class SessionWrapper implements Connection {

        private final Session session;

        public SessionWrapper(Session session) {
            this.session = session;
        }

        @Override
        public String getId() {
            return session.getId();
        }

        @Override
        public boolean isOpen() {
            return session.isOpen();
        }

        @Override
        public void sendObject(Object object) {
            try {
                session.getBasicRemote().sendText(NextRTCServer.MessageEncoder.encode(object));
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }

    @OnOpen
    public void onOpen(Session session, EndpointConfig config) {
        server.register(new SessionWrapper(session));
    }

    @OnMessage
    public void onMessage(String message, Session session) {
        server.handle(NextRTCServer.MessageDecoder.decode(message), new SessionWrapper(session));
    }

    @OnClose
    public void onClose(Session session, CloseReason reason) {
        server.unregister(new SessionWrapper(session), reason.getReasonPhrase());
    }

    @OnError
    public void onError(Session session, Throwable exception) {
        server.handleError(new SessionWrapper(session), exception);
    }
}

Without web.xml servlet container sometimes doesn't scan classes and your Endpoint can be omitted during class loading. You can find working example here.

How to register own signal

In manualConfiguration method if you want to provide your own signal you have to register it during server creation.

NextRTCServer server = NextRTCServer.create(configuration -> {
    configuration.signalResolver().addCustomSignal(/* custom signal is going here */);
    return configuration;
});

Configuration object provides you ability to modify properties configuration.nextRTCProperties(), and it also provides you configuration.signalResolver(). To add your own signal you have to just add to signal resolver your own signal

private static final NextRTCServer server = NextRTCServer.create(configuration -> {
   configuration.nextRTCProperties().setPingPeriod(1);

   configuration.signalResolver().addCustomSignal(Signal.fromString("upperCase"), (msg) ->
           configuration.messageSender().send(InternalMessage.create()
                   .to(msg.getFrom())
                   .signal(Signal.fromString("upperCase"))
                   .content(msg.getContent() == null ? "" : msg.getContent().toUpperCase())
                   .build()));

   configuration.eventDispatcher().addListener(new CustomHandler());
   return configuration;
});
}

In this example new handler (upperCase) will take a content of incoming message and resend the content to sender with uppercase letters.

How to react on events

If you want to handle event that comes from server you have to create class that implements interface implements NextRTCHandler, and give annotation @NextRTCEventListener(<event>). Class that implements interface and has EventListener annotation has to be registered during manual configuration. Here is example with basic handler.

@NextRTCEventListener(UNEXPECTED_SITUATION)
public class ExceptionHandler implements NextRTCHandler {
    private static final Logger log = Logger.getLogger(ExceptionHandler.class);
    @Override
    public void handleEvent(NextRTCEvent nextRTCEvent) {
        log.error(nextRTCEvent);
    }
}
...
private static final NextRTCServer server = NextRTCServer.create(configuration -> {
    configuration.eventDispatcher().addListener(new ExceptionHandler());
    return configuration;
});
}

How to send messages to client

When you will write your own signal, you probably will send a result of processing to some member of conversation. To do so you just have to do two things. Firstly you have to find member to whom you want to send message. You can do it by autowiring MemberRepository. Bean that implement this interface will return member to whom you can easily send message.

class SomeClass {
    @Autowired
    private MemberRepository members;
    
    public void fetchById(String id){
        Optional<Member> memberOptional = members.findBy(id);
    }
}

To be able to send a message to member you have to autowire MessageSender, then create an InternalMessage and send it.

class SendMessage {
    @Autowired
    private MessageSender sender;
    
    public void sendTo(Member to){
        sender.send(InternalMessage.create()
            .to(to)
            .content("whatever you like")
            .signal(Signal.fromString("my_signal"))
            .build()); // method send will send message synchronously
    }   
}

In standalone mode you have to do the same. You can find MessageSender in EndpointConfiguration bean.

Architecture of NextRTC - Overview

NextRTC uses event bus to communicate with other components. Internally NextRTC is taking request object then based on signal field is looking for appropriate handler. When handler exists it code is executed. During execution NextRTC can send messages to client via websocket and can produce predefined events on what you can react in your application.

When your code can be run?

You can react on following events:

  • SESSION_OPENED
    • Is posted when client opens websocket channel
  • SESSION_CLOSED
    • Is posted when client close websocket channel
  • CONVERSATION_CREATED
    • Is posted when conversation has been created
  • CONVERSATION_DESTROYED
    • Is posted when conversation has been destroyed
  • UNEXPECTED_SITUATION
    • Is posted on every unexpected situation - broken pipe, forbidden action
  • MEMBER_JOINED
    • Is posted when member has been added to conversation
  • MEMBER_LEFT
    • Is posted when member has left the conversation
  • MEDIA_LOCAL_STREAM_REQUESTED
    • Is posted after offerRequest / answerRequest signals are sent to clients
  • MEDIA_LOCAL_STREAM_CREATED
    • Is posted when signal offerResponse / answerResponse arrives to server
  • MEDIA_STREAMING
    • Is posted when clients exchanged all required signals to connect themselves by WebRTC
  • TEXT
    • Is posted on each text message coming from client

To be able to react on event you have to write java class which implements NextRTCHandler and has annotation @NextRTCEventListener. You can customize on what certain event your handler will react by giving it name to annotation @NextRTCEventListener(UNEXPECTED_SITUATION). If you are using NextRTC with Spring then your handler should be also annotated with one of Spring stereotype annotations (@Service, @Component ...)

Signal structure

Each request coming in and out of server have structure like this:

{
    "from": "",
    "to": "",
    "signal": "",
    "content": "",
    "custom" : {}
}

custom can contains only string properties, deeper nesting will produce error. Valid request/response can look like this:

{
    "from": "John",
    "to": "Alice",
    "signal": "TEXT",
    "content": "Hello Alice!",
    "custom" : {
        "myCustomHeader": "my custom value",
        "otherHeader": "value"
    }
}

Custom is used to determine version of conversation. When you are creating new conversation you can add to custom field type with value MESH or BROADCAST. Depending on value in type field signaling server will create different conversation type.

Field signal

In signal field you can pass one of default defined signals:

  • create
  • join
  • offerResponse
  • answerResponse
  • finalize
  • candidate
  • ping
  • left
  • text

Or give your own custom signal - how to define custom signals you can read here. Server can send to messages with default predefined signals or with custom defined by you. Default group consists of:

  • created
  • joined
  • newJoined
  • text
  • offerRequest
  • answerRequest
  • candidate
  • ping
  • error
  • end

Changes

If you want to check what has been done you can check CHANGELOG

nextrtc-signaling-server's People

Contributors

jemakom avatar mslosarz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nextrtc-signaling-server's Issues

Nextrtc in a distributed context?

Hello
I'm considering using nextrtc and wondering how it works in a distributed context with multiple backend servers?
If not, can the internal bus be replaced by hazelcast to allow this (it's just an idea)?
Thanks

Invalid bean definition with name 'nextRTCEventBus' defined in org.nextrtc.signalingserver.NextRTCConfig

main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'nextRTCEventBus' defined in org.nextrtc.signalingserver.NextRTCConfig: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.nextrtc.signalingserver.NextRTCConfig; factoryMethodName=eventBus; initMethodName=null; destroyMethodName=(inferred); defined in org.nextrtc.signalingserver.NextRTCConfig] for bean 'nextRTCEventBus': There is already [Generic bean: class [org.nextrtc.signalingserver.api.NextRTCEventBus]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL [jar:file:/C:/Users/lue/.m2/repository/org/nextrtc/signalingserver/nextrtc-signaling-server/1.0.0-RC6/nextrtc-signaling-server-1.0.0-RC6.jar!/org/nextrtc/signalingserver/api/NextRTCEventBus.class]] bound.

Lost signals

I found a problem where some messages (offerRequest most of the time) weren't delivered. The solution we found here is to call getRemotePeer().flushBatch() on the method send() in class InternalMessage.
Now, it works every time.

Is it possible to use nextRTC in mobile using for example ionic or native developing?

Hi! We've reached stage that we need a mobile version of our project. We using nextRTC in our backend development and it works fine with client-browser mode. As we know that noone RTC based frameworks don't work with iOS from browsers (even chrome) that's why we have some questions. We decided to create mobile application, it will be perfect if we use ionic 2 for mobile development because our engineers have experience in that only (we can't create native applications for ios and android because), that's why we would like to hear, at least, your opinion about our idea and possibilities? Is it possible to create mobile working version for android and ios at all? Thanks

Signals stop working

Hi, I am using version v1.0.0-RC1, and sometimes the signals stop responding, I do not know why or what causes it.
Its difficult to reproduce. but happens occasionally.
Are you familiar with the issue ?
Please advise how to debug the reason and whats going on in the server .
thanks

How to use this library to create a java client

How to use this library to create a java client (no j2ee) but plain java simpe multiuser chat room

  1. Initiator x 4 users using client IDs joined into a room
  2. Send text or binary data to each other

Join or create?

I'm trying to create a simple videochat usable by non IT people: I would like to have a single "join" button instead of having the users to figure if they should create or join a conversation.

How to I achieve this with nextRTC?

Authentication and security

I have an existing web application running in tomcat. I want to use this signalling server integrated with its user system and allow only those who are part of my user system to create rooms. Is there a way to do so? if so how do we make it?

Does this signaling server broad cast the SDP message to all those who are listening(kept open the index.html) to the signaling server?

In other words I want to know the aspects of security if we are going to use this.

Doesn't support more than two users

Hi, i saw your project its awesome.But i see it doesn't support more than two users at once, the second user is replaced with the third user when he joins new and if third with fourth, that happens so on. What can i do to have more than two users displayed?

Use modern logging framework

Log4j 1 had reached end of life. Maybe it is worth to use logging facade like slf4j and allow end user to decide which logging implementation they want.

Close websocket after webrtc connection estasblished

hi
a. I am trying to reduce server resources per connection, and one of the problems is that for each endpoint there is an open websocket and thread this uses allot of server resources and seems not necessary , what would be the best way to handle this issue? would it be ok just to close the websocket connection after webrtc negotiation is done ?

b. I want to send custom messages to a member from the server ( from a spring service in the server ), is there a service I can use to do that ?

custom JoinConversation

Hi,
How can I add a custom implementation for JoinConversation ?
I want to add a join signal, that will not create a conversation if it doesn't exist?
I can see there is a way to add custom signals, but I am having problems to add an override to JoinConversation.
Can you please help with an example ?

How to find "main class" in nextrtc-signaling server

Hi,
I success to build nextrtc-signaling server.
but when I try to run, that error appear like this below.

"Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java (default-cli) on project nextrtc-signaling-server: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.5.0:java are missing or invalid"

Where and what is mainClass in nextrtc - signaling server?

Additionally,
If I want to use signaling server, do I need to create or modify your code?

I searched about your code, but I did not find anything about your code enough.
If you are OK, please reply my questions.
Thanks.

Project build error

I'm trying to checkout source code and import to eclipse, but it show me an error as:
The import org.nextrtc.signalingserver.DaggerNextRTCComponent cannot be resolved

screen shot 2017-09-08 at 10 20 56 am
How can I resolve it?

Thank you,

Text chat support ?

Hello again,
I've seen you talked about text chat support in the 6# issue (closed).
I don't see any documentation on this feature, can you provide a short one ?

Often video connection is not work

We've created project which allow people to connect with each other and see each other.

Our logic is when people start conversation it sends http request to backend for checking is there anyone who exist and waits for conversation also or not. If it's not it sends signal 'Create' and wait for another person. Second person also works with this logic and when he presses button 'Start' he sends http request and he detects that already someone exists in conversation and send to backend 'Join' signal.

From algoritm and logic everything is fine I think.
But there is a problem when, for example, they talk and see each other and someone decides to leave conversation and after some time (let it be fast for example 5 sec) he wants to join again and we get problem. He can join and it sends 'Join' signal also they are connected but Video translation is not work and honestly we can't catch this bug in production.
Sometimes it works fine but from 10 times this bug appears 3-4 times.

We have "Leave" button also, it appears when conversation from two people is created and they start see and talk. When person clicks "Leave" button it does "this.nextRTC.leave();" action and when callback comes that connection is closed I open it again via initNextRtc(); And it works like this every time when I leave or press F5 button.

  1. first Image shows how works perfect

1

  1. when I start reconnect it should connect me to the same person. But we can't see each other. By the way we can hear each other but no see. We don't know why.
    2

  2. this logs, please pay attention to what's happening after 'Join' signal. I mean nothing happens but it should make a lot of logs after that about candidate and so on.

dddddd

By the way, when every time person makes reconection sometimes it throws "java.io.IOException: An established connection was aborted by the software in the host machine" exception but anyway connection works fine. Maybe our bug is because of this?

Could you give us advcie how to correct 'leave' from conversation please?

And please, if you avaliable in skype add me Kascheypro. Because we create project which is not open source and screens may break some policy our company.

Thank you!

NAT traversal

Has this server means to traverse NAT: STUN/TURN support?

Will it work over internet or only inside LAN?

Is nextRTC use a single thread to handle connections ?

I'm trying to understand the code and I feel that there is a single thread that handle all incoming connections but I'm not sure of it.

I've read carefully the documentation and it's not mentioned anywhere that the server is single threaded or using multiple threads to handle connections.

It would be useful to make the documentation more clear on this point.

Thanks,

RTP Streaming through the browser

Hi Marci,

I'm in the middle of building your project and I was just wanting to know if this would be possible with your nextRTC project.

I have an existing spring web application that streams rtp media to a client but I'm using a java applet to accomplish this.
It uses a low level recorder that streams the RTP on a UDP port of the client.
The RTP streams are streams coming from PSTN -> IP phone calls.
So I was thinking of moving to WebRTC using your project to get rid of the java applet.
I've already created a peer and am able to send out the candidates to the web socket.
Now, whenever I get an Ice Candidate, I would like to change the rtp port of the ice candidate to be the port where the low level recorder is streaming the RTP.

My questions would be,
#1. How do I identify, from an ICE candidate, that such candidate corresponds for the audio RTP?
#2. Is it safe to change the ICE candidate port? When I tried this out, the establishment of the connection when creating an answerer-offerer scenario on a client failed.

I basically do not want 2 clients to make calls to each other. I just want to stream an existing RTP media to a client.

Please let me know what you think.

Thank you.

Chat and data channel support

I was successfully able to run your demo on video chat.

Do you have a demo on Chat and data channel as well?

If there is a support how do we make it happen?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.