HTTP/HTTPS上のすべてのデバイス間のデータのストリーミング


こんにちは!私は、devコミュニティに非常に新しいです.今日は、HTTP/HTTPSの上で、ほぼすべてのデバイス間のデータストリーム転送を導入したいと思います.

何を解決したいですか?


Mac、Windows、Linux、Unix、iPhone、Androidの間でデータを転送することもあります.私たちはエアドロップ、Googleドライブ、dropbox、スラック、WhatsApp、Skypeがあります.netcat , ssh などが必要です
  • 送付者と受信機によって使用される一般的なサービスを見つける
  • GUIのインストール
  • サービスを申し込む
  • 解決NAT横断
  • また、ほとんどの既存のデータ転送サービスは、フレンドリーではなく、GUIフレンドリーではありません.
    そこで、上記の問題点を解決しました.システムを使用すると
  • ほぼすべてのデバイスでデータを転送する
  • 追加インストールなしで使用する
  • Unix/Linuxパイプで使用し、エンジニアフレンドリーです
  • 実際の使用


    私が作ったシステムの使い方を紹介します.
    転送するデモはこちらseq 100000 .

    送信:seq 100000 | curl -T - https://ppng.io/myseqゲットcurl https://ppng.io/myseqここに100 MBのファイルを転送するデモがあります.

    送信:cat 100MB.dat | curl -T - https://ppng.io/mydataゲットcurl https://ppng.io/mydata > mydataパイプを使用して任意のデータを転送することができます.例えば、
    圧縮と送信:cat myfile | gzip | curl -T ...取得と解凍:curl ... | zcat > myfileand
    暗号化と送信cat myfile | openssl aes-256-cbc | curl -T ...ゲット&デcurl ... | openssl aes-256-cbc -d > myfileand
    ディレクトリを送信するzip -q -r - ./mydir | curl -T - https://ppng.io/mydir.zipディレクトリ( tar . gz )を送信します.tar zfcp - ./mydir | curl -T - https://ppng.io/mydir.tar.gzブラウザにデータを転送するデモです.

    ブラウザからデータを転送するデモです.

    これは、Android/iPhone/iPadからファイルを転送することができます.別のデバイスに!

    複数受信機への転送



    ターミナル画面共有!



    シェアscript -f >(curl -T - https://ppng.io/myscript >&/dev/null)ビューcurl https://ppng.io/myscript使用script -F の代わりにscript -f )

    githubリポジトリ


    プロジェクトは以下のリンクで見つかったパイピングサーバーです.
    ギタブhttps://github.com/nwtgck/piping-server

    新技大 / パイピングサーバー


    純粋なHTTP上のすべてのデバイス間で無限に転送、すべてのユーザーのためのUNIXパイプを使用してもブラウザのユーザーのために設計


    パイピングサーバー




    HTTP/HTTPS上のすべてのデバイス間の無限転送

    転移


    配管サーバは簡単です.次のように転送できます.
    # Send
    echo 'hello, world' | curl -T - https://ppng.io/hello
    # Get
    curl https://ppng.io/hello > hello.txt

    Piping Server transfers data to POST /hello or PUT /hello into GET /hello. The path /hello can be anything such as /mypath or /mypath/123/. A sender and receivers who specify the same path can transfer. Both the sender and the recipient can start the transfer first. The first one waits for the other.

    You can also use Web UI like https://ppng.io on your browser. A more modern UI is found in https://piping-ui.org, which supports E2E encryption.

    ストリーム

    The most important thing is that the data are streamed. This means that you can transfer any data infinitely. The demo below transfers an infinite text stream with seq inf.

    考え

    This project is written in TypeScript.

    パブリックサーバー

    Here are public servers. My recommendation is https://ppng.io because it has a short name.

    In my policy, you can freely run the servers. I'd like to describe how to run later.

    You can get engineer-friendly help from the following.

    $ curl https://ppng.io/help
    <Help will be displayed here>
    

    動作方法


    パイピングサーバはPEARのターンサーバのようなものです.配管サーバーは、NATの横断を解決するために別のデバイスにデータを中継する.
    POST/PUT HTTPリクエストの本体はGET HTTPレスポンスの本体に渡されます.

    パイピングサーバーを走らせる方法


    パイピングサーバを動かす方法はいくつかあります.一人ずつ紹介したいのですが.

    地獄


    ボタンを押すhttps://github.com/nwtgck/piping-server .

    ポータブルバイナリ実行可能


    以下のコマンドはパイピングサーバを走らせるhttp://localhost:8888 .
    wget https://github.com/nwtgck/piping-server-pkg/releases/download/v0.8.7/piping-server-macos
    chmod +x piping-server-macos
    ./piping-server-macos --http-port=8888
    
    また、2009年にGitHubリリースで他のプラットフォームのリリースを見つけることができますhttps://github.com/nwtgck/piping-server-pkg . ポータブル実行可能ファイルはzeit/pkg .

    ドック


    エーdocker run パイピングサーバーを走らせるhttp://localhost:8888 .
    docker run -d --restart=always -p 8888:80 nwtgck/piping-server --http-port=80
    

    国立天文台


    以下のコマンドはパイピングサーバを起動させるhttp://localhost:8888 .
    # install
    npm install -g piping-server
    # run
    piping-server --http-port=8888
    

    HTTPによるデータ転送の可能性


    HTTP上でどのように多くのデータを転送できるかを示す実験をしています.
    私は実験を55日と7時間前に始めました、そして、1000以上のテラバイトデータは移されました.
    実験方法は次の通りである.
    無限に送信するcat /dev/urandom | curl -T - localhost:8888/rand無限破棄curl localhost:8888/rand > /dev/null

    移動速度に比べて転送速度


    ここでは、typescript/ノード間の転送速度の単純な比較です.JSとGoの実装動画の結果、ほとんど違いがないようです.
    ノード/ノード.js
    ゴー
    レポgo verhttps://github.com/nwtgck/go-piping-server

    日本郵便


    これが私のオリジナルの日本のポストですhttps://qiita.com/nwtgck/items/78309fc529da7776cba0 .
    あなたは、より多くの情報をそこで得ることができます.
    読書ありがとうございます.素晴らしい一日を!