lark

next

Code Create Life
telegram
tg_channel
x
github
zhihu
email
follow

Deploy WebSSH on Koyeb to solve IPv6 and SSH connection issues.

Since WARP was blocked, we have been unable to access pure IPv6 servers, and we cannot connect to serv00 via SSH after it was blocked. To solve these problems, we can deploy a WebSSH.

First, fork this repository: huashengdun-webssh

Next, modify the webssh/settings.py file and add utf-8 after default to prevent Chinese garbled characters in the code output.

define('encoding', default='utf-8',
       help='''The default character encoding of ssh servers.
Example: --encoding='utf-8' to solve the problem with some switches&routers''')
define('version', type=bool, help='Show version information',
       callback=print_version)

Deploying on Koyeb#

image

Select the forked repository and adjust the region to Washington, D.C.

Replace the Run command with:

python run.py --xsrf=False --xheaders=False --origin='*' --debug --delay=6

image

Change the port to 8888 and click on Deploy.

Using Cloudflare Workers for Reverse Proxy#

Replace app.koyeb.com in the code with the domain provided by Koyeb.

addEventListener('fetch', (event) => {
  event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
  let url = new URL(request.url);

  // Replace "app.koyeb.com" with your Koyeb app domain
  const targetHostname = 'app.koyeb.com'; 

  const workerHostname = request.headers.get('host');

  if (url.hostname === workerHostname) {
    url.hostname = targetHostname;

    let newRequest = new Request(url, request);

    return fetch(newRequest);
  } else {
    return new Response('Not Found', { status: 404 });
  }
}

Screenshots#

image

image

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