-1

I wrote a Java Application that works with sockets (you know, I open a SocketServer in some port, for example 8000). The application works very well, but now I want to deploy it to some server. I've tried with Heroku, but it just opens ports 80 and 443. I also tried with AWS and Digital Ocean, but both require a Credit Card (I don't have one :'( ) to get access to a Virtual Machine, and have the control of it.

What do you suggest me (another PaaS or another solution)? Thanks, beforehand.

2 Answers2

1

Oh, I could solve it. It seems that there is an environmental variable called PORT, and all the connections to port 80 are redirected to that port. I'll run my Application in PORT, and it will be all. All the messages from port 80 will be redirected to PORT.

0

Did you try a -p option for changing the port with heroku?

heroku local -p 7000

The Roy
  • 2,178
  • 1
  • 17
  • 33
  • I guess that command will only open the port in my local machine. Is there a way to open a different port in the remote server? Thanks for your quick answer. – Cristian Motoche Feb 09 '16 at 14:38