-
Notifications
You must be signed in to change notification settings - Fork 45
dmsgweb
Dmsgweb is an application which permits access to websites over dmsg with a web browser via proxy configuration.
The idea for the dmsgweb
implementation was inspired by that of i2p, which allows access to .i2p
domains or websites in a similar manner via a proxy configuration in a web browser. Dmsgweb can be additionally configured with the proxy provided by i2p in order to access i2p websites as well as .dmsg websites. The TOR browser may also be configured with dmsgweb's resolving proxy, if desired, and if dmsgweb is configured with the i2p proxy in addition, it is possible to browse .onion, .dmsg, and .i2p domains at once, if desired.
Dmsgweb is available from skycoin/dmsg and will be included in future binary releases of the dmsg
repo.
Dmsgweb is available as a subcommand of the skywire merged binary release as skywire dmsg web
(Skip this step if you have installed a binary release which already includes dmsgweb
)
To compile; first clone the dmsg repository and update the vendor dependencies
git clone https://github.com/skycoin/dmsg
cd dmsg
git checkout develop
go mod tidy ; go mod vendor
Now, either compile dmsgweb to a binary:
go build cmd/dmsgweb/dmsgweb.go
Or run it directly with go run
$ go run cmd/dmsgweb/dmsgweb.go --help
┌┬┐┌┬┐┌─┐┌─┐┬ ┬┌─┐┌┐
│││││└─┐│ ┬│││├┤ ├┴┐
─┴┘┴ ┴└─┘└─┘└┴┘└─┘└─┘
Usage:
dmsgweb
Available Commands:
completion Generate the autocompletion script for the specified shell
gen-keys generate public / secret keypair
Flags:
-d, --dmsg-disc string dmsg discovery url default:
http://dmsgd.skywire.skycoin.com
-f, --filter string domain suffix to filter (default ".dmsg")
-l, --loglvl string [ debug | warn | error | fatal | panic | trace | info ]
-p, --port string port to serve the web application (default "8080")
-r, --proxy string configure additional socks5 proxy for dmsgweb (i.e. 127.0.0.1:1080)
-e, --sess int number of dmsg servers to connect to (default 1)
-s, --sk cipher.SecKey a random key is generated if unspecified
(default 0000000000000000000000000000000000000000000000000000000000000000)
-q, --socks string port to serve the socks5 proxy (default "4445")
-v, --version version for dmsgweb
This application is very simple and has two main parts which are wrapped in a cobra cli
framework to provide the help menu.
The application consists of
- a resolving socks5 proxy which can be configured in a web browser (default http port 4445)
- an http server which translates requests to and copies responses from a dmsg(http) client (default http port 8080).
Another socks5 proxy (i.e. the skywire socks5 proxy client - default socks5://127.0.0.1:1080) can be configured via the -r
flag to force both the regular http traffic as well as the dmsg client connection to the dmsg network itself through another proxy. As mentioned above, it's also possible to configure the i2p proxy for dmsgweb.
It is suggested to first create a keypair for the dmsg client to connect with. This step is optional, but recommended:
dmsgweb gen-keys > dmsgweb.key
If desired, configure a locally running skywire visor's proxy client for this application. refer to the socks5 proxy user guide article from this wiki for starting the proxy client.
After completing the above two steps, start dmsgweb like this:
dmsgweb -s $(tail -n1 dmsgweb.key) -r 127.0.0.1:1080
If you skipped the previous two steps, start dmsgweb without flags or arguments; and a keypair will be generated automatically:
dmsgweb
Note: it is not advisable to whitelist any public key used by dmsgweb without explicitly generating the keypair and saving to a file as detailed in the above steps.
To configure this application in a web browser, use SOCKS5 proxy 127.0.0.1:4445 (default in dmsgweb).
The process of configuring a proxy in different web browsers is described in the socks5 proxy user guide article. Simply change the port to 4445.
A few experimental dmsg websites exist, notably the skywire reward system frontend fiber.skywire.dev which can be accessed here:
http://036a70e6956061778e1883e928c1236189db14dfd446df23d83e45c321b330c91f.dmsg
fiber.skywire.dev/health will indicate the dmsg address it is running on.
The dmsghttp log server's /health
endpoint may be accessed over dmsg for any skywire visor - if that visor is indeed connected to dmsg.
The custom dmsghttp path field in the visor's config specifies a custom path which is served by the visor over dmsghttp. This is by default a folder called "custom" inside the local_path
or local
folder of the skywire installation.
Any files added to the custom dmsghttp path may be accessed over dmsghttp.
If an index.html
is added, a static website is readily possible for any running skywire visor and may be accessed by the visor's public key.
For advanced integration of dmsg with existing websites, see the dmsghttp article
While dmsgcurl
and similar utilities use a custom URL scheme: dmsg://<pk>:<port>/
this is not supported by browsers.
To access websites over dmsg, use the following scheme:
http://<pk>.dmsg:<port>/
If the application uses the default dmsg port 80, the port can be omitted and the URL specified as follows
http://<pk>.dmsg/
Web Browsers vary to some degree in their support for accessing .dmsg addresses which are entered directly in the URL / search bar.
It may be necessary to disable auto-https redirects in settings.
For Brave browser, no matter how the .dmsg URL is entered in the search bar, a search is performed. However, clicking the link to the reward system frontend here will permit access to the dmsg website(!):
http://036a70e6956061778e1883e928c1236189db14dfd446df23d83e45c321b330c91f.dmsg
There is no apparent way to disable this behavior, however, a workaround is to create an html document and include the link to the dmsg website which one desires to access.
Open the html document in the browser, and then click the link in the document to access the dmsg website.
please contact support via telegram @skywire
for rewards and technical support