I have hosted my simple UDPServer program on AWS Ubuntu 14.04, it's working correctly their, but when i tried accessing it from my system, am not able to connect to it, surely it is, something to do with AWS firewall, so how can i make my UDP traffic to pass through it! And port of my UDP server is 2020.
Any help would be greatly appreciated!
Thanks.
I was also looking for possible workaround for this issue, but it's quite easy irrespective of what platform language you are using to develop socket program on AWS EC2, as am using Node.js nginx in my case, this should work for all supporting platforms.
Configure Security Group
In the AWS console, open the EC2 tab.
Select the relevant region and click on Security Group.
You should have an default security group if you
have launched an Elastic Beanstalk instance in that region for your
app.
click on Actions button at top, and select Edit inbound rules.
here in Type column select All UDP, or you can set some Custom UDP
rule as well to listen at your socket port.
And there just enter port of your UDP server 2020.
And that's it!
Note: If something is not working, check the "Events" tab in the Beanstalk application / environments and find out what went wrong.
Related
I am able to succesfully use my dropwizard application when accessing with localhosts, but it doesnt work when I access with a different machine. Is there something you need to do make your web application respond to hosts besides localhosts?
I know with flask you must run with the flask run --host=0.0.0.0 is there a setting in the config file which controls this.
If you connect from the same network you´ll probably have an windows firewall issue (if you run on windows) or any other firewall depending on the OS.
You´ll have to allow inbound connections for the specific application on or port 80/443 TCP.
If you´re trying to connect from another network then it probably still is the above but you also have to setup port-forwarding to the machine running your application.
If it´s HTTP, probably port 80. If HTTPS then probably 443, for any other protocol you have to find out the correct port.
Since it´s dropwizard it´s probably HTTP/HTTPS, depending if it has to be secure (definatly recommended for REST APIs)
So I wanted to try to let one person connect to my WebSphere Application Server remotely. I've already opened up a port on my router, but I don't really know what is the port that WebSphere uses. I couldn't really find much on the internet, and WebSphere is a hell of a complex thing to handle.
I've already tested it on https://www.portchecktool.com/ so the port is not blocked by any firewall.
By connecting remotely I mean that I have a java web application up and running and I want this other person that is not inside my house to be able to get into the application and use it.
I'm using RAD IDE just in case it might help out knowing it.
So where can I find the port that my server uses, in order to then configure to forward connections to that port?
I don't know RAD, but there are a couple ways to find out looking at WebSphere itself. If you are already in the admin console, you can to go to Servers in the left pane, click on your server's name, look for the ports link on the right column, and expand that. Look for the defaulthost_secure (or plain defaulthost if not using https.) If you don't, find where WebSphere is installed on your filesystem. There is a file WAS_INSTALL_ROOT/profiles/profileName/logs/AboutThisProfile.txt that lists some common ports including defaulthost and defaulthost_secure.
I am trying to connect to aws-ec2 instance having activemq service running. I am trying to connect it using tcp transport connector using an application built under java + maven + git setting.
I am doing this exercise to add network latency to compare activemq with aws-sqs, which will help us in deciding which one to use for our requirements.
what I have tried so far:
I am able to run this application locally as I scp'ed into ec2 added my code there and it ran locally, which led me to believe that amq service is running.
I also ran the same setting from my home network it is working fine, so home computer -> ec2 connection is also working.
It is just not working from my office network, which led me to believe that it is failing because of some kind of firewall setting?
A simple netstat -a | grep 61616 gave me that it is listening on port 61616.
Does anyone know where I am going wrong? Or suggest some more debugging techniques?
EDIT: Security rule at aws-ec2
I made application with java using socket. My computer is the server and my phone(android ) is the client. Only what i trying to do is to forward String from phone to client PC.
Everything works fine when i configure my router and open the port i using. i don't want every time when costumer will install my application will need to open port in the router.
I thought about using remote server that will run my server code. but i didn't find server that can do that . i don't want to make my pc a server for all costumers.
How does all the chats companies do it without open port?
You must look into UPnP. This is what /most/ if not /all/ torrent clients use to allow foreign connections, without forwarding ports. How chat clients do it is a different scenario. They use hacks such as firewall hole-punching using UDP (with an external server) http://www.h-online.com/security/features/How-Skype-Co-get-round-firewalls-747197.html see this link for details on UDP hole punching.
Also see this article http://www.codeproject.com/Articles/13285/Using-UPnP-for-Programmatic-Port-Forwardings-and-N for usage of UPnP. But this is in C++, but I think you will understand.
EDIT: http://4thline.org/projects/cling/ I found this. I think it can help you.
You had to open port probably because of your routers firewall :). If you already opened let us say port 9090 then every client app (android phone) will be able to connect to it :). Of course if somebody wants to install server on their own pc they would problably forward some ports and disable some firewalls. If you want server with no special requriements lookup VPS'es. :)
I have developed a Java server using Eclipse that accepts TCP socket connection from android client, performs some computations, and returns the result to the android phone using this socket. I tried it on Wi-Fi.
I want now to move the Java server to the cloud - basically amazon EC2. Is this possible? I am just using a simple tcp socket connection. I have checked and couldn't find an example but came across "elastic beanstalk". Any help is appreciated, maybe a link or tutorial with such an example.
can i convert my java project to .war and use it or can i install eclipse on the cloud and run it as i do locally?
It is definitely possible. And you don't have to convert your project to a .war, unless you want to.
All you have to do is:
Pick the Amazon Image (AMI) you want to use - Amazon Linux is a good place to start, but there are plenty of other options, including Ubuntu and Windows.
Set up a security group - you need to set an incoming rule for your server's port number. It is pretty easy to do this from the Amazon web-based console.
Start a machine and assign it to the security group you created. Again, this is easily accomplished from the amazon web console.
Once the machine is up, log in (using ssh for Linux or Remote Desktop for windows) and install your server.
A few things to remember:
Since you are now running on a public server, sooner or later your server will be attacked. EVERYONE gets attacked. If all you are opening is your single application port, make sure it is secured.
An Amazon server has a private and public IP. Your client application will connect to the public IP.
Servers can fail, and new servers get new public IPs! You need to prepare for this. Either make the IP in the client configurable, or look into something like Amazon Elastic IPs or dynamic DNS.