TEST12138

TEST12138

长路漫漫,唯心作伴。

Once you poop, use it everywhere.

Remote Development Environment#

Prerequisites#

Don't want to spend money on a server, but have idle devices at home, like NAS, etc.

Required Content#

A server, a free domain name, Cloudflare account

Operations#

Install SSH on your server and enable it.
Host the domain on Cloudflare.

image

Click on Zero Trust on the left side of Cloudflare.

Click on Tunnels under Network.

image

Then click on Create Tunnel to create a tunnel.

image

Click the three dots on the right side and select Configure.

image

Then go back to the server and choose to install based on your server system.

image

Then click on the Public Hostname above.

image

Click Add Public Hostname, name the subdomain as you like, the domain at the back should be the one bound when creating the tunnel, select SSH for the type, and I tested that filling in localhost for the URL works fine.

image

After setting up, open your local VSCode, search for SSH in the extensions, and install Remote-SSH.

image

After installation, an icon will appear next to it, click it.

image

Then click the settings button next to SSH.

image

Just select the first option.

image

Fill in the domain name you just set, the user is the login user, I am using key-based login here, so there will be a file path for IdentityFile; if not, delete this line and use password login.

image

After saving, a host will appear next to it.

image

The arrow connects in the current window, while the one behind opens in a new window.
But it cannot connect now because it uses Cloudflared for internal network penetration, so you need to install the Cloudflared client on your local machine.
Visit https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/
Choose to install based on your operating system.
After installation, click Connect and wait a moment.

image

Choose a folder where you created your project, and create a project directly.
My server's development environment is already set up, so I can create it directly.

image

image

Later, if you switch devices for development, you only need to install the Cloudflared client and the Remote-SSH plugin on VSCode, without repeatedly installing Node.js and node_modules, as node_modules is like pulling a large chunk onto your computer.

image

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.