zrok/assets/js/07d0b302.2f581655.js

1 line
5.7 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8905],{3103:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>c,default:()=>l,frontMatter:()=>r,metadata:()=>i,toc:()=>a});var o=t(5893),s=t(1151);const r={sidebar_position:22},c="Sharing HTTP Servers",i={id:"concepts/http",title:"Sharing HTTP Servers",description:"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.",source:"@site/../docs/concepts/http.md",sourceDirName:"concepts",slug:"/concepts/http",permalink:"/docs/concepts/http",draft:!1,unlisted:!1,editUrl:"https://github.com/openziti/zrok/blob/main/docs/../docs/concepts/http.md",tags:[],version:"current",sidebarPosition:22,frontMatter:{sidebar_position:22},sidebar:"tutorialSidebar",previous:{title:"Reserved Shares",permalink:"/docs/concepts/sharing-reserved"},next:{title:"Sharing TCP and UDP Servers",permalink:"/docs/concepts/tunnels"}},d={},a=[];function h(e){const n={code:"code",h1:"h1",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.h1,{id:"sharing-http-servers",children:"Sharing HTTP Servers"}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.code,{children:"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 ",(0,o.jsx)(n.code,{children:"zrok share"})," command using the ",(0,o.jsx)(n.code,{children:"--backend-mode proxy"})," flag."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"--backend-mode proxy"})," is the default backend mode, so if you do not specify a ",(0,o.jsx)(n.code,{children:"--backend-mode"})," you will get the ",(0,o.jsx)(n.code,{children:"proxy"})," mode by default."]}),"\n",(0,o.jsxs)(n.p,{children:["If you have a web server running on ",(0,o.jsx)(n.code,{children:"localhost"})," that you want to expose to other users using ",(0,o.jsx)(n.code,{children:"zrok"}),", you can execute a command like the following:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"$ zrok share public localhost:8080\n"})}),"\n",(0,o.jsxs)(n.p,{children:["When you execute this command, you'll get a ",(0,o.jsx)(n.code,{children:"zrok"})," bridge like the following:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{children:"\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502 http://cht7gj4g5pjf.share.zrok.io \u2502\u2502[PUBLIC] [PROXY]\u2502\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\n\u2502