Question

I have two web hosts. One with a standard shared hosting provider, and the other: AWS Free Tier. I would like for these two servers to be able to communicate with one another. Basically, I would like the shared server to send some information to the AWS server, causing the AWS server to run certain scripts.

I am familiar with python, so am wondering if there is some python library I can use to quickly cook up a script that would listen to a certain port (on AWS). Also, security is in issue: I want AWS to only listen to requests from a certain IP. Is this possible? What python libraries could I use for something like this?

I am fairly new to web programming and wasn't able to google the solution to this. Thanks!

No correct solution

OTHER TIPS

Since you are already using aws, for something like this you couldconsider using AWS SQS to add a queue between the two hosts and communicate thru it instead of directly.

Using SQS, it would be easy to write a script to add messages to the SQS queue when something needs to be run on the other host, and equally easy for the second host to poll the queue looking for messages.

Adding a queue between the two hosts decouples them, and adds a bit of fault tolerance (i.e. one of the hosts could go off line for a bit without the messages being lost), and possibly gives you the ability to scale up if you need to a bit easier (for example, if you ever needed multiple instances at aws processing jobs from the other host you could just add them and tell them to also poll the same queue, as opposed to building in a 1-1 'always on' dependency between the two.

Lots of different ways to skin this cat, so maybe the approach above is overkill in your case, but thought I'd throw it out there as something to consider.

Take a look at Python Network Programming. It should get you started.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top