Easy way to setup a cloud TCP server? - tcp

We have a device that sends data to a TCP server if we provide it the PORT and IP. We were unable to find a simple implementation of the TCP server like Firebase or AWS. What is the easiest way to setup a cloud TCP server? And how do we make the server send commands to a 3rd party app when it receives data from the device?

Related

Is there somebody who knows how to send data from a webhosted webdomain to a ESP32 using http get request?

The question is, how can we send data from the Webhosting domain to our esp32 with an HTTP GET Request?
If the ESP32 is behind a local network this is not possible.
If you want to initiate a request from outside of the network where the ESP32 is, you must put the esp32 to the internet.
You can port forward the ESP32's ip address/port on your router. That way you can reach the esp32 via your router's public ip. That way you can do any HTTP request to the ESP32 from anywhere in the world.
I warn you however that this method is not recommended since your network will be open to the outside world on the port you opened.
An other way is to use some kind of a tunnel server.
There are solutions for that such as ngrok or husarnet
I would recommend you to create a server somewhere in the cloud and fetch the desired data from that server with the esp32. Since you can request data inside your local network from the outside.

Using coTurn TCP allocations with DataChannel

I have configured a coturn server which I need to use with DataChannel for a chat app.
I am trying to reach a point where I can get the coturn server provide me with a tcp allocation.
I am using the standard call of RTCPeerConnection in JS client, providing the turn URI, username and credentials.
The transport I am providing in the URI params is TCP ?transport=tcp.
With all this, I am always receiving a UDP allocation and the server logs ChannelBind requests (UDP based)
Question:
How can I achieve TCP allocations throught webRTC client, to guarantee proper data delivery of the chat app in case of using my relay server?
RFC 6062, opening a TCP port on the TURN server is not supported by WebRTC. It is optional in the spec and nobody needs it since reliability is provided by SCTP.
TCP in the turn uri refers to the protocol between the client and the TURN server

Pivotal cloud foundry - Application listening on TCP port

I am trying to run an test app on pivotal cloud foundry, that listens on TCP port 2222. I was able to create a TCP route however i was not able to reach this server from a client outside, any ideas? on the same vm i am able to connect.
You need to talk to your platform operator. In addition to mapping a TCP route to your app, you need to have load balancers configured to route TCP traffic into the platform.
Please check with your platform operator to see if the following steps have been performed.
https://docs.pivotal.io/pivotalcf/2-3/adminguide/enabling-tcp-routing.html

Configure a server inside LAN

I'm currently working on my group voice chatting program. This is my plan:
Build up a server on 192.168.1.125. Listen to port 3490 and forward it to the router.
Clients connect to the server and get the user IP list(Whenever a client connects to the server, its IP address is recorded by the
server)
Clients communicate with each other using UDP multicast(is this ever possible across the router?).
But now I'm running into troubles. If a client inside the LAN, e.g. 192.168.1.120, connects to the server, it's taken down as 192.168.1.120, which won't work for clients from WAN.
I'm wondering if there is any way to convert the LAN IP to public IP? (this might have something to do with the router, I think)
Thanks.
You will have to be prepared for the case where direct client-to-client communication fails. Relaying through the server or NAT traversal/penetration may be necessary. Significant expertise is required to do this correctly.

Does TCP use another port for sending data?

I heard that for TCP connection, server will listen on 1 port, and use another port for sending data.
For example, web server listen on port 80. Whenever client connects to it, this server will use another port (say 9999) to send data (web content) to client. If multiple clients connect to it, does this server create multiple "another ports" to send data back ?
And does the client uses 2 ports (listening port and sending-data port) as the server does ?
Am I right? I heard many people said that and I can't find any good books or articles about this
Please explain
I heard that for TCP connection, server will listen on 1 port, and use another port for sending data.
No. The same port is used for both listening and for accepted connections, and the same connection is normally used for both sending and receiving. TCP connections are bidirectional. FTP is an exception to this, as it uses two connections: one for commands and one for data.
For example, web server listen on port 80. Whenever client connects to it, this server will use another port (say 9999) to send data (web content) to client.
No.
If multiple clients connect to it, does this server create multiple "another ports" to send data back ?
No.
And does the client uses 2 ports (listening port and sending-data port) as the server does ?
No.
Am I right?
No.
I heard many people said that
They were all wrong.
and I can't find any good books or articles about this
There aren't any. Only a very bad book or article would say any such thing.
Here is a simple example.
When the browser in your laptop sends a request to a web server which listens on port 443, your OS uses an ephemeral port (e.g. tcp/3105) as source port and Port tcp/443 of the web server as the destination port.
Once the web server sends back the response, it will use the source port as tcp/443 and the destination port as tcp/3105.
Here is a link to an AWS documentation.
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html

Resources