TCP/IP and http diagramm deploiment - java

I'm really stuck at diagram deploiment
I have a web browser that communicates with a server aplication via TCP / IP.
is that it changes anything when I change tcp / Ip on http
knowing that the application is to use just at a local network in the company

You can use http on a local network, I don't see the problem here.

Related

Public to Local IP Communication

I have created project which has two components as Desktop client and web.
web server is communicating to the my another program which i run as client on other systems.
After connecting those clients communication is happening in network as all IP's within network are reachable.
However, when i deployed web app on public IP now i am not able to connect the clients as the local IP's of those clients are not reachable by server.
How can i achieve this communication between local IP to public and vice versa?
There are multiple ways to achieve this.
Anyways, if you want the service to be reachable publically then you´ll probalby want to forward the Port to the machine running the service.
Also, make sure the Firewall allows connections to this port.
Since you´re talking about Web-Apps it´s probably HTTP, Port 80 TCP, or HTTPS, the encrypted version of HTTP running on port 443 TCP.
To explain it, your ISP gives you one public IP address.
Since you probably have multiple devices using internet, they all appear in the internet as the one IP address your provider gave you.
Whenever you send something out your router will remember where you tried to connect and if a response comes in your router knows which device to send the response to.
Now, since you want someone to connect to you, there was no request so your router does not know where to put the packet and simply blocks it.
In most routers you can configure something usually called NAT or Port Forwarding. You simply specify that communication on Port 80 or 443 should be routed to the internal IP. It has one of the following formats:
192.168.0.1 - 192.168.255.254
172.16.XXX.XXX - 172.31.255.254
10.0.0.0 – 10.255.255.254

How can I use java sockets to communicate between different networks?

I have java programs for my client and server, and they work fine within the same wifi network. But I need the clients to be able to connect to the server from the open internet. In questions like these
How to connect client and server with the help of ip address which are connected to internet through different wifi?
https://coderanch.com/t/667020/java/Socket-connections-networks
the solution is to manually reroute a port to the server from the router, making it open to connections from the outside. Is there a way to do this with just software on the server? I don't understand why manually dedicating ports is necessary since of course other applications on my computer (like games) that I install communicate with their servers back and forth without me having to manually go in and flip switches.
How can I achieve this with just software running on my server?
If there isn't another way, how do other applications communicate openly without manual router changes, and will opening up ports through my router result in security issues?
You would need to change the architecture of your application. Currently, your server is behind a firewall which blocks connections from the internet - you want this! If you allowed all traffic from the internet to connect indiscriminately to your server, it would be very vulnerable to attack.
Other applications install and communicate without port-forwarding because the developer provides a server on the internet to act as a proxy between clients. The client connects out to the internet which is generally not blocked on home networks. Internal connections going out are considered less harmful than connections coming in.

InternetAccess with Jetty and a Webserver. Client-Server Communication 2 machines, computer, java

I need some advice in the following matter:
I have two machines that are connected via ethernet.
One machine (lets call it ServerSide) is also connected to the Internet via LAN. The second machine (ClientSide) is offline, in the beginning.
So ServerSide is creating a webserver with Jetty on port XY. ClientSide opens a webbrowser and requests some page (e.g. stackoverflow.com). The request will be forwarded to port XY and the webserver. ServerSide would have to send the request to the internet and then back over ServerSide to ClientSide, so the webbrowser should display the requested webpage.
Is it even possible to do that this way?
Thanks in advance
Yes. What you need on server side is an HTTP Proxy and there are plenty of existing solutions in the market.
Check out the Wikipedia article about proxies. Bear in mind that the client might require some configuration (Proxy settings) so that it forwards the requests to the proxy rather than attempting to reach the final host.

Node.js remote server not working (Etherpad Lite)

I'm running a server-side application on a remote server, using a particular port - call this port 9000. Using a separate laptop, I've been able to telnet to a simple Java hello world TCP server and to access a HTTP server through my browser. These listened to port 9000 and were made using the standard Java libraries and com.sun.net.httpserver. However, when I use Node.js to create an application (i.e. server.listen(9000, 0.0.0.0)), I cannot connect to that application.
Is there something additional I should do to create a successfully listening HTTP server using Node.js? Any additional dependencies? As per above, assume there are no firewall issues between my laptop and my server.
For a larger context, the program I'm trying to run is etherpad-lite, which uses Node.js to create a server.
Don't include the IP address of 0.0.0.0.
This is telling the server to only listen to requests to that 'hostname'.
Just use
server.listen(9000);

Get Port of Incoming Request - App Engine, Java

I have an application running on Google App Engine and a client connects to the server at a specific URL performing an HTTP POST (or GET or whatever) request. My question is simple: how would I go about obtaining the client's port?
Thankyou for any help anyone here can provide!
--- Additional Info ---
Note that in most cases 'Client's port' = a translated port that the Client's Modem's NAT set. If a NAT is present, I do not require the client's local port on their computer that they are using to hit the server, for this is of little use to me. Instead, I require the port from the Modem's public IP that will redirect the request to my original client.
I need this info to send more data to the client (through sockets) at some later point in time. Straight after its initial post request, the original client creates a server socket that listens for requests from the server. The server is only able to send requests to the client if it knows the ip:port of the client.
I am aware of the issue request below. It is 3.5 years old though, and still no action has been taken - it will never be fixed. I was hoping that someone here might know of a workaround.
https://code.google.com/p/googleappengine/issues/detail?id=4210&q=Type%3DDefect&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log&start=100
Afaik, the info on remote TCP port is not available via GAE APIs.
Most of the time clients are behind NAT so they are not accessible from internet, i.e. even if the have a listening port open, you can not Make a TCP connection to it due to one-way nature of NAT translation.
If a client has a public IP, then they can just simply tell server on which port they will be listening and you can then use URL Fetch or Outgoing Sockets to make a connection.

Categories

Resources