I am working on a client/server model for transfering some data read from a changing file on the client site (window tkinter client which watches for file changes) and transfer it to a server to process the data (split the data into lists and make some stuff with it).
What is the best solution for this in your eyes. One of the must haves is it needs to be secure so I though about including some ssl encryption with a self written cert and include it into the client. should I use pure socket programming in python or something like gevent or twisted? The client only connects when the watched file has changed, greps the data, connects to the server, transmit it and disconnect. can happen 10 times an hour or 10 times a day its not really calculable.
open for any suggestions and experience for similar issues.
thanks dave
UPDATE FYI: there will always only be 1 server and 1 client!
UPDATE 2: Also is it possible to include a ssl way that only the client who does have the one part of the certificate can connect to this specific server so to prevent others from connecting to it?
I would just go with JSON over HTTP(s), makes things easy. It doesn’t look like you need much raw performance, and all the libraries for JSON and HTTP are already included in the stdlib.
No need to run Apache or anything, you can just run a tiny web server from within Python:
http://docs.python.org/2/library/wsgiref.html#module-wsgiref.simple_server
You can use client certificates with SSL, but not many people do, so it might not be easy to setup. Instead, you could just pick a large enough random string as a “password” that the client must include in the request. If you want to get all fancy, you could use TOTP one-time passwords.