Cloudflare Tunnels
This guide will show you how to use Cloudflare Tunnels. With Cloudflare Tunnels you can use a domain with an SSL certificate for your website.
Requirements
- A Cloudflare account
- A domain name with Cloudflare DNS
- A website running on our servers.
Getting started
1. Login to Cloudflare
Navigate to the Cloudflare Zero Trust Dashboard (If it asks you to select a plan to pay for, close that tab and open a new one. All of the things we need are available in the Free plan) and login with your Cloudflare account.
Then, on the sidebar, click on Zero Trust
, open the dropdown menu under the Networks
section, and select Tunnels
.
2. Create a Tunnel
-
Click on
Create a Tunnel
-
Choose
Select Cloudflared
-
Enter a name for your tunnel (e.g.: "My Website Tunnel" or "AFK Hosting Tunnel")
-
Click
Save Tunnel
-
Select the
Windows
option and copy the command that is shown. It should look something like this:cloudflared.exe service install ey...
-
Open your server's Startup tab and paste the command into the
Cloudflared Tunnel Token
field, then REMOVE THEcloudflared.exe service install
PART so it looks like this:eyabOigTzHBvW0UU82RWenDe6UfGfwE2nCIS3zJOJi4vjwQnEvcO6p2uRNuv1T87huOibpkhLgqpzZhUDcEBCyXKuwvpbv7UsORcIOF1EC6Vsotq3uufLM1QyJfFirI3MPqTzkcbD8XeNTBgQfwZrMpRyZgFYcbmTanTFBf1CyieTuxR1V7QyUh8
-
Toggle the
Enable Cloudflare Tunnel
switch toON
-
Restart your server.
-
Once your server has restarted, you should now see a new item in the
Connectors
section of the Tunnels dashboard. Once you see this, click theNext
button. -
You will now be taken to the
Public Hostname
tab. Here you can create a hostname for your website.- Website
- SnailyCAD
-
Subdomain: This is the subdomain you want to use for your website. For example, if you want to use
store.example.com
then you would enterstore
here. -
Domain: The domain connected to your Cloudflare account. Use the domain you want to use for your website.
-
Path: Leave empty.
-
Service Type: Select
HTTP
-
URL: Go to the
Console
tab of your server, copy theAddress
field, and paste it here. For example, if your address isus1.afkhosting.win:39600
, then you would enterus1.afkhosting.win:39600
here.
Click the
Complete Setup
button to create the hostname. You can now visit your website by going to the subdomain you just created (e.g.,store.example.com
) instead of the Address in theConsole
tab.SnailyCAD Client Tunnel
In the current form, enter the information for your SnailyCAD Client. This is the URL that you will use to access the CAD.
- Subdomain: This is the subdomain you want to use for your SnailyCAD Client. For example, if you want to use
cad.example.com
then you would entercad
here. - Domain: The domain connected to your Cloudflare account. For example, if you want to use
cad.example.com
then you would enterexample.com
here. - Path: Leave empty.
- Service Type: Select
HTTP
- URL: Go to the
Network
tab of your server, copy the Hostname and Port for allocation that you created for the SnailyCAD Client, and paste it here seperated by a colon (:
). For example, if your Hostname isus1.afkhosting.win
and your Port is39600
, then you would enterus1.afkhosting.win:39600
here. Click theComplete Setup
button to create the hostname.
SnailyCAD API Tunnel
The current tunnel only accepts the SnailyCAD Client, so you will need to create a second Public Hostname for the SnailyCAD API. To do this, follow the steps below:
- Click on the name of the tunnel you just created.
- Click on the
Edit
button in the upper right corner. - Navigate to the
Public Hostname
tab. - Click on
Add a public hostname
. - Enter the configuration for your domain:
- Subdomain: This is the subdomain you want to use for your SnailyCAD API. For example, if you want to use
cad-api.example.com
then you would entercad-api
here. - Domain: The domain connected to your Cloudflare account. For example, if you want to use
cad-api.example.com
then you would enterexample.com
here. - Path: Leave empty.
- Service Type: Select
HTTP
- URL: Go to the
Network
tab of your server, copy the Hostname and Port for allocation that you created for the SnailyCAD API, and paste it here seperated by a colon (:
). For example, if your Hostname isus1.afkhosting.win
and your Port is39601
, then you would enterus1.afkhosting.win:39601
here.
- Subdomain: This is the subdomain you want to use for your SnailyCAD API. For example, if you want to use
- Click
Save
. You should now see two Public Hostnames in thePublic Hostname
tab. One for the SnailyCAD Client and one for the SnailyCAD API.
Configuring SnailyCADYou will need to configure SnailyCAD to use the new Public Hostnames you just created. Follow the steps below to do this:
- Go to the
Startup
tab of your SnailyCAD server. - Set the
Client URL
to the Public Hostname you created for the SnailyCAD Client. For example,https://cad.example.com
. - Set the
API URL
to the Public Hostname you created for the SnailyCAD API. For example,https://cad-api.example.com
. (Note: DO NOT add/v1
at the end of the URL) - Set the
Domain
to the domain you used for the Public Hostnames. For example,example.com
.
To apply the changes, you will need to restart your SnailyCAD server.
You can now visit your SnailyCAD Client by going to the subdomain you just created (e.g.,
cad.example.com
) and your SnailyCAD API by going to the subdomain you created for it (e.g.,cad-api.example.com
).