Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How should my local server communicate with an EC2 server?

How should my local server communicate with an EC2 server?

Problem

I have a node.js server running on ec2. I'd like for that server to automatically push data to another node.js server that is running on my laptop.

What is the best way to do something like this?

Problem courtesy of: fancy

Solution

You could use a service like showoff.io to create an entry point to access your local laptop, or you could just create an SSH tunnel by running this command on your laptop:

ssh -R port:localhost:remoteport ec2-host

That will allow port on the loopback interface of your EC2 server to connect to remoteport on your laptop.

Then just modify your code to connect to the node.js program running on your laptop via the IP of 127.0.0.1 and port of port.

Solution courtesy of: staackuser2

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

How should my local server communicate with an EC2 server?

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×