Total Pageviews

Monday, 20 April 2020

暴露内网的web server到公共网络的工具digto

A service to help to expose HTTP service to the public network 

Digto

GoDoc codecov goreport
A service to help to expose HTTP/HTTPS service to the public network. The interface is designed to be easily programmable. For example you can use curl command only to serve public https request without any other dependency.

Proxy a local port

  1. Install the client: curl -L https://git.io/fjaxx | repo=ysmood/digto sh
  2. Run digto my-domain :8080 to proxy https://my-domain.digto.org to port 8080

Use curl only to handle a request

Open a terminal to send the request:
curl https://my-subdomain.digto.org/path -d 'ping'
# pong
my-subdomain can be anything you want. As you can see the request will hang until we send a response back. Let's open a new terminal to send the response for it:
curl -i https://digto.org/my-subdomain
# HTTP/2 200
# digto-method: GET
# digto-url: /path
# digto-id: 3dd4e560
#
# ping

# the value of digto-id header must be the same as the previous one
curl https://digto.org/my-subdomain -H 'digto-id: 3dd4e560' -d 'pong'
After we send the response the previous terminal will print pong.