zrok/docs/concepts/http.md

32 lines
2.2 KiB
Markdown
Raw Normal View History

2023-06-26 18:57:04 +02:00
---
sidebar_position: 22
---
2023-06-26 19:00:23 +02:00
# Sharing HTTP Servers
2023-06-26 18:57:04 +02:00
2023-06-26 19:28:04 +02:00
`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.
2023-06-26 18:57:04 +02:00
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.
If you have a web server running on `localhost` that you want to expose to other users using `zrok`, you can execute a command like the following:
```
$ zrok share public localhost:8080
```
When you execute this command, you'll get a `zrok` bridge like the following:
```
2023-06-26 19:15:18 +02:00
╭───────────────────────────────────────────────────────────────╮╭────────────────╮
│ http://cht7gj4g5pjf.share.zrok.io ││[PUBLIC] [PROXY]│
╰───────────────────────────────────────────────────────────────╯╰────────────────╯
╭─────────────────────────────────────────────────────────────────────────────────╮
│ │
│ │
│ │
│ │
╰─────────────────────────────────────────────────────────────────────────────────╯
2023-06-26 18:57:04 +02:00
```
The URL shown at the top of the bridge shows the address where you can access your `public` share.
Hit `CTRL-C` or `q` in the bridge to exit it and delete the `public` share.