Giter Site home page Giter Site logo

erl-momental_storage's Introduction

NAME

momental storage

SYNOPSIS

  $ 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

DESCRIPTION

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.

HOW IT WORKS

  1. server waits request
  2. receiver requests GET to the server
  3. server notifies session ID to the receiver by Location HTTP header
  4. receiver requests to the location, and waits response from the server
  5. receiver tells session ID to the sender (ordinary, this may done by copy and paste)
  6. sender PUT a file to the server with session ID
  7. server receives a file from sender, and reply to the receiver
  8. sender finishes send, and server too, then receriver completes GET

URLs

/r/:filename

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.

/d/:id

Is Data path.

This internal URL shows session which bridges between receiver and sender.

id shows session ID which connects both clients.

/s/:id

URL for the Sender.

Sender send PUT request to the URL which includes session ID.

id shows session ID which connects both clients.

INSTALL

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

erl-momental_storage's People

Contributors

kuniyoshi avatar

Stargazers

David.Gao avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.