momental storage
$ curl -v -k -L -O https://localhost:8080/r/somefile.txt
...
< HTTP/1.1 302 Found
...
< location: http://localhost:8080/d/BB88A3F45FE1DE8A62759AA4C148EB68859A9EEADEED6BD8EA1388D4732B756B3D45242C6C6ECB35D86EA826D3DBEAEC9AF67ECF221F3193DD353A8741268
...
$ curl -k -T README.md https://localhost:8080/s/BB88A3F45FE1DE8A62759AA4C148EB68859A9EEADEED6BD8EA1388D4732B756B3D45242C6C6ECB35D86EA826D3DBEAEC9AF67ECF221F3193DD353A8741268
This module provides a link between receiver and sender. The link is used to copy a file.
We have many way to this work, e.g., rsync
, scp
, and more, but these require localy link.
If there is no link that connects receiver and sender with directly, then this module makes a bridge to these.
- server waits request
- receiver requests
GET
to the server - server notifies session ID to the receiver by Location HTTP header
- receiver requests to the location, and waits response from the server
- receiver tells session ID to the sender (ordinary, this may done by copy and paste)
- sender
PUT
a file to the server with session ID - server receives a file from sender, and reply to the receiver
- sender finishes send, and server too, then receriver completes
GET
URL for the Receiver.
Receives GET
request, and tell the receiver to a URL that may PUT
from a sender.
filename
is used to specify a filename to save.
Is Data path.
This internal URL shows session which bridges between receiver and sender.
id
shows session ID which connects both clients.
URL for the Sender.
Sender send PUT
request to the URL which includes session ID.
id
shows session ID which connects both clients.
Place SSL certificate file to priv/ssl
, or change code to use HTTP instad of HTTPS.
The code can change protocol scheme from HTTPS to HTTP editing the src/momental_storage.app.src
.
In the file, change disable_https
from false
to true
, then the application work with HTTP.
$ make
$ _rel/momental_storage/bin/momental_storage-0.1 console