better web/files sharing guide

This commit is contained in:
Michael Quigley 2023-06-26 13:28:04 -04:00
parent 061fb697e9
commit a345df9397
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
5 changed files with 28 additions and 6 deletions

View File

@ -11,16 +11,38 @@ was run from.
For example if you have a directory with a structure like this: For example if you have a directory with a structure like this:
```shell ```shell
-rwxrwxrwx 1 cd cd 2506 Jan 26 11:57 README.md -rw-r--r--+ 1 Michael None 7090 Apr 17 12:53 CHANGELOG.md
-rwxrwxrwx 1 cd cd 2971 Jan 26 11:57 CHANGELOG.md -rw-r--r--+ 1 Michael None 11346 Apr 17 12:53 LICENSE
-rwxrwxrwx 1 cd cd 41544024 Jan 26 12:00 zrok -rw-r--r--+ 1 Michael None 2885 Apr 17 12:53 README.md
-rwxr-xr-x+ 1 Michael None 44250624 Apr 17 13:00 zrok.exe*
``` ```
The files can be shared using a command such as: The files can be shared using a command such as:
```shell ```shell
zrok share public . --backend-mode web zrok share public --backend-mode web .
``` ```
Then the files can be access with a `private` or `public` share, for example as shown: Then the files can be access with a `private` or `public` share, for example as shown:
![zrok_public_share](../images/zrok_share_file.png) ![zrok_share_web_files](../images/zrok_share_web_files.png)
`zrok` will automatically provide a stock website, which will allow the accessing user to browse and navigate the file tree. Clicking the files allows the user to download them.
`zrok` can also share a pre-rendered static HTML website. If you have a directory like this:
```shell
-rw-rw-r--+ 1 Michael None 56 Jun 26 13:23 index.html
```
If `index.html` contains valid HTML, like this:
```html
<html>
<body>
<h1>Hello <code>zrok</code></h1>
</html>
```
Sharing the directory will result in the following when you access the share in a web browser:
![zrok_share_web_website](../images/zrok_share_web_website.png)

View File

@ -4,7 +4,7 @@ sidebar_position: 22
# Sharing HTTP Servers # Sharing HTTP Servers
`zrok` can share HTTP and HTTPS resources natively. If you have an existing web server that you want to share with other users, you will use the `zrok share` command using the `--backend-mode proxy` flag. `zrok` can share HTTP and HTTPS resources natively. If you have an existing web server that you want to share with other users, you can use the `zrok share` command using the `--backend-mode proxy` flag.
The `--backend-mode proxy` is the default backend mode, so if you do not specify a `--backend-mode` you will get the `proxy` mode by default. The `--backend-mode proxy` is the default backend mode, so if you do not specify a `--backend-mode` you will get the `proxy` mode by default.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB