Can Kurento run as a WebSocket client? - server

I understand that Kurento Server is called this way for a reason, but can it be configured (or hacked) to run as a client in terms of the Kurento Protocol?
According to the Kurento 6.6.1 documentation:
Previous to issuing commands, the Kurento Client requires establishing
a WebSocket connection with Kurento Media Server to the URL:
ws://hostname:port/kurento
But since we would like to run our Kurento Server behind NAT that doesn't have a dedicated IP address and doesn't allow DDNS and port forwarding, it would be really nice if Kurento could connect to our signaling server (WebSocket-based) and permanently sustain that connection. When web-based client connects to that signaling server, a connection would be negotiated between the WebRTC server (Kurento) and the client (browser) via signaling. – Well, that's our hope, at least, since RTSP connection to our camera also cannot be established from the Internet.
See the diagram of what we are trying to achieve:
Thanks.

Related

How to find out if a client is connected to a pymodbus tcp server

I have a pymodbus server running and I'd like to know if a client is connected to it that it is serving. Is there any way to do that? I can't see an obvious way.
I'm using the synchronous server:
pymodbus.server.sync.ModbusTcpServer

TCP Socket communication of HTTP client and server

Just some concept about TCP Socket, let's say there are 100 clients simultaneously communicating with a traditional HTTP/TCP web server. How many sockets are respectively at the server and at each client? Do all of the sockets at the server
have the same server-side port number?
The question is generic, so the answer is going to be as well.
For traditional TCP-based HTTP server, there will be 100 sockets on the server (one for each client), and one socket on every client. All server sockets will be bound to the same server port.
This answer doesn't take into account the fact that in modern HTTP model a client usually opens more than one socket to serve a single request.

Does an HTTP tunnel take place on the same socket than CONNECT?

I'm trying to implement an HTTP proxy for learning and debug purpose.
The support of plain HTTP transactions was pretty straightforward to implement and now I'm looking to implement support for SSL/TLS tunnels.
From RFC 7230:
A "tunnel" acts as a blind relay between two connections without
changing the messages. Once active, a tunnel is not considered a party
to the HTTP communication, though the tunnel might have been initiated
by an HTTP request.
It's not very clear whether I shall build the TLS socket from the socket on which the HTTP CONNECT transaction took place. I assume it is the case, since HTTP is stateless, but I just want to be sure.
When a client connects to an HTTP proxy, CONNECT is used to have the proxy establish a persistent TCP connection with the target TCP server. Then the proxy blindly passes data as-is back and forth between the two TCP connections until either the client or server disconnects, then the proxy disconnects the other party. This allows the client to send data to the server and vice versa, such as TLS packets. This is important so the TLS server can verify the client's identity during the TLS handshake.
So, to answer your question - yes, the client must establish a TLS session with the target server using the same TCP socket that it used to issue the CONNECT request on. Once the CONNECT request has succeeded, the client can treat the existing TCP connection as if it had connected to the server directly. The proxy is transparent at that point, neither party needs to care that it is present.

How do to initiate a connection-less socket (datagram) to a UDP server in browser?

I need to connect and send data packets to a UDP server (connection less/datagram socket) from within a browser.
What are my options?
Does HTML5 allow connection-less sockets?
Would I be able to connect to a UDP server (connection-less socket) using a WebSocket?
Your options are very limited. Browsers which support WebSockets expect the server to speak WebSocket to them (which involves participating in a 2-way handshake). Communicating in raw UDP is an entirely different kettle of fish.
Chrome has experimental support for raw UDP, but only for Chrome extensions.
I don't know of any other browser with this in the works, or for Chrome to make it available for websites.
Your best best would be to change your endpoint to talk WebSocket, or to use a middleman server (NodeJS would be great for this) to handle the Websocket <-> raw UDP conversion.

send data between two server sockets

I have to make an app using C/PHP sockets on linux that sends data from one socket to other socket, like this.
I have server (server_hosted) hosted somewhere with an IP or domain name. It is running web application.
I have another server (unknown_server) running at my home (unknown IP).
Client send some information through web application hosted in server_hosted to another server running at my home (unknown IP).
I need a way to established a connection between server_hosted and unknown_server.
I was able to make connection between both using TCP socket. I made server_hosted as server listen to certain port says 8080 and unknown_server as client, which make open connection to server_hosted.
The problem comes when I have multiple unknown_server at my home. How can I made connection to same port? How many client can TCP/IP support?
Any ides how to make tunnel or connection between server_hosted and unknown_server.
Is possible to do with curl or socket any better ideas?