All Projects → ostrolucky → Stdinho

ostrolucky / Stdinho

Licence: other
🔌 Turn any STDIN/STDOUT into HTTP server

Projects that are alternatives of or similar to Stdinho

T Io
解决其它网络框架没有解决的用户痛点,让天下没有难开发的网络程序
Stars: ✭ 1,331 (+1009.17%)
Mutual labels:  http-server
Netty Rest
Yet another high performance REST server based on Netty
Stars: ✭ 107 (-10.83%)
Mutual labels:  http-server
Qhttpengine
HTTP server for Qt applications
Stars: ✭ 112 (-6.67%)
Mutual labels:  http-server
Http.swift
A tiny HTTP server engine written in swift.
Stars: ✭ 99 (-17.5%)
Mutual labels:  http-server
Restbed
Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++14 applications.
Stars: ✭ 1,551 (+1192.5%)
Mutual labels:  http-server
Daraja Framework
A lightweight HTTP server framework for Object Pascal (Delphi 2009+/Free Pascal 3.0) based on Indy
Stars: ✭ 108 (-10%)
Mutual labels:  http-server
Proxy.py
⚡⚡⚡Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging
Stars: ✭ 1,291 (+975.83%)
Mutual labels:  http-server
Swiftyhttp
A simple GCD based HTTP client and server, written in 'pure' Swift
Stars: ✭ 115 (-4.17%)
Mutual labels:  http-server
Mofuw
mofuw is *MO*re *F*aster, *U*ltra minimal *W*ebserver.
Stars: ✭ 107 (-10.83%)
Mutual labels:  http-server
Reverse proxy plug
🔛 an Elixir reverse proxy Plug with HTTP/2, chunked transfer and path proxying support
Stars: ✭ 112 (-6.67%)
Mutual labels:  http-server
Cherrypy
CherryPy is a pythonic, object-oriented HTTP framework. https://docs.cherrypy.org/
Stars: ✭ 1,363 (+1035.83%)
Mutual labels:  http-server
Gaea
Gaea is a Gin-based web framework, reference gin https://github.com/gin-gonic/gin
Stars: ✭ 105 (-12.5%)
Mutual labels:  http-server
Srv
minimalist http(s) server and file browser
Stars: ✭ 109 (-9.17%)
Mutual labels:  http-server
Meinheld
Meinheld is a high performance asynchronous WSGI Web Server (based on picoev)
Stars: ✭ 1,339 (+1015.83%)
Mutual labels:  http-server
Purescript Httpure
A web framework written in PureScript.
Stars: ✭ 112 (-6.67%)
Mutual labels:  http-server
Searchspot
The service responsible for Honeypot's ElasticSearch data
Stars: ✭ 90 (-25%)
Mutual labels:  http-server
Httpbin
HTTP Request & Response Service, written in Python + Flask.
Stars: ✭ 10,423 (+8585.83%)
Mutual labels:  http-server
Fenix
A simple and visual static web server with collaboration features.
Stars: ✭ 1,559 (+1199.17%)
Mutual labels:  http-server
Hummingbird
Lightweight, flexible HTTP server framework written in Swift
Stars: ✭ 114 (-5%)
Mutual labels:  http-server
Zetaipc
A tiny .NET library to do inter-process communication (IPC) between different processes on the same machine.
Stars: ✭ 111 (-7.5%)
Mutual labels:  http-server

stdinho

Latest Version on Packagist Software License Build Status Coverage Status

stdinho is small command-line tool that creates TCP server, accepts any STDOUT as its STDIN and whoever connects to the server will get this data served as HTTP response.

It was written from frustration of having to share remote resources with my under-priviliged colleagues on semi-regular basis. This typically involves downloading file, uploading file, sending the link, waiting until target finishes downloading file, deleting file. In each stage of the process you would normally have to wait.

stdinho animation

Install

Via Composer

composer global require ostrolucky/stdinho

Or grab executable PHAR file from Releases

Usage

As simple as just piping some data in:

echo hello world|stdinho

For all options see

stdinho --help

Features

  • async. Yep, in PHP. No restriction on clients downloading simultaneusly
  • buffers to temp file before client is connected, so no time or data in between is lost
  • cross-platform: Linux/MacOS/Windows
  • detects MIME type and attaches it to HTTP response
  • neat progress bar showing status of buffering and client downloads.

Recipes

Video streaming

# Server
$ stdinho 0.0.0.0:1337 < /file/to/a/movie.mp4
# Client
$ firefox http://127.0.0.1:1337
Simple one-way chat

# Server
# Server (broadcaster)
$ { while read a; do echo $a; done }|bin/stdinho 127.0.0.1:1337
# Client
curl 127.0.0.1:1337
Tail application logs in realtime

# Server
$ tail -f project/var/log/*.log|stdinho 0.0.0.0:1337
# Client
$ curl 127.0.0.1:1337 

# Bonus: gzip transfer encoding (server)
$ tail -f project/var/*.log|gzip -c|stdinho 0.0.0.0:1337 --http-headers='["Content-Type: text/plain", "Content-Encoding: gzip", "Transfer-Encoding: gzip"]'
Stream a folder, including compression

# Server
$ zip -qr - project|stdinho 0.0.0.0:1337 -f project.zip
# Client
$ curl 127.0.0.1:1337 -o project.zip # Saves it to project.zip
Dump remote database and stream it to different database on the fly via middle man

# Server
$ ssh [email protected] "mysqldump -u root -ptoor database|gzip -c"|stdinho 0.0.0.0:1337 -f "$(date).sql.gz" # also saves the backup locally
# Client
$ curl 127.0.0.1:1337|gunzip|mysql -u root -ptoor database # Import it directly to local DB
Use case from GIF in this README

#   There is bad connectivity between A (public server) and B (user connected to network via special VPN), 
#   but good connectivity between A and C (on same local network as A, but not public). 
#   However, B and C are behind NAT in separate networks, so there is no direct connection between them.
#   Here D is introduced, which is public server having good connection to both C and B, but no connection to A. 
#   In final, download stream goes like this: A -> C -> D -> B which bypasses connection problem between A and B and NAT issue at the same time
#   This problem is basically animation shown in introduction of this README.
# C:
$ ssh -NR \*:1337:localhost:1337 D #Reverse tunnel. Note: GatewayPorts cannot be set to "no" in D's sshd_config
$ curl http://A.com/big_file.tar.gz|stdinho 0.0.0.0:1337
# B:
$ curl D:1337 -o big_file.tar.gz

Licensing

GPLv3 license. Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].