Uses a combination of HTTP put and the php://input
wrapper to stream a file to a remote host over a socket
Please note you will need to set up hosts to run this example
- Make sure python and the python requests module are installed: sudo pip install requests
- Set the hosts up, most likely at your localhost. There are constants in the php file, and a constant at the top of put.py. You will need to setup hosts in your hosts file as well.
- Run remote_server.py. This is just an example service that will listen indefinitely on a socket on the machine it is run on. It represents the remote service you'll be forwarding to.
- Run put.py. This will fire an http request sending the included image file to whatever host you setup for the php. The php will then open a socket to remote_server and stream it there... you should see the bytes of the image in your terminal for remote_server.py!