简体   繁体   English

tunnlr之类的服务如何工作?

[英]How does a service such as tunnlr work?

The website says: 该网站说:

Tunnlr uses SSH remote tunneling. Tunnlr使用SSH远程隧道。 It securely connects a port on your local machine to an open port on our public server. 它将本地计算机上的端口安全地连接到我们公共服务器上的开放端口。 Once you start your Tunnlr client, the web server on your local machine will be available to the rest of the world through your special Tunnlr URL. 启动Tunnlr客户端后,本地计算机上的Web服务器将通过您的特殊Tunnlr URL可供世界其他地方使用。

Could someone please go into a bit more detail over how this entire process works? 有人可以详细介绍整个过程如何工作吗? Or maybe point to something open source that allows the same thing? 还是指向允许相同功能的开放源代码?

The SSH protocol allows tunneling of connections in either direction. SSH协议允许双向建立连接。 So based on the description above here's what is happening: 因此,根据上面的描述,这是正在发生的事情:

  1. You download a client program (an SSH client) to your computer and run it. 您将客户端程序(SSH客户端)下载到计算机上并运行。
  2. The client establishes an SSH connection out from your computer to the tunnlr remote server 客户端建立从您的计算机到tunnlr远程服务器的SSH连接
  3. On the tunnlr server an access port is opened for incoming connections. 在tunnlr服务器上,打开了用于传入连接的访问​​端口。 Let's say port 1234. 假设端口1234。
  4. Now when anyone connects to tunnlr:1234 the tunnlr server will instruct your client program through the connection established in step 2 to open a connection inside your computer - let's say to port 80 (eg you're running a webserver there). 现在,当任何人连接到tunnlr:1234 ,tunnlr服务器将通过步骤2中建立的连接指示您的客户端程序打开计算机内部的连接-假设连接到端口80(例如,您在此处运行Web服务器)。
  5. The tunnel connection will now shuffle data between tunnlr:1234 and your_computer:80 . 现在,隧道连接将在tunnlr:1234your_computer:80之间tunnlr:1234数据。

So effectively this is what is running: 因此,有效的运行方式是:

[some_remote_computer]<->[tunnlr:1234]<->[SSH tunnel]<->[your_computer:80]

Assume some_remote_computer is your friend or anyone else you want to be able to connect to your local web server. 假设some_remote_computer是您的朋友或您希望能够连接到本地Web服务器的其他任何人。

SSH is available for many platforms (Linux, Windows, OSX and more). SSH可用于许多平台(Linux,Windows,OSX等)。 You can build such tunnels quite easily with it, but you will of course need access to both computers you want to build the tunnel between. 您可以使用它很容易地建立这样的隧道,但是您当然需要访问要在其间建立隧道的两台计算机。 Let's say one computer is your own computer and another is a VPS you've rented (or any other remote server with SSH access). 假设一台计算机是您自己的计算机,另一台是您租用的VPS(或任何其他具有SSH访问权限的远程服务器)。 Now you can run exactly the same setup. 现在,您可以运行完全相同的设置。

The advantage with tunnlr is they manage the remote server for you, and they have a registered hostname you can use for your tunnels. tunnlr的优点是它们为您管理远程服务器,并且它们具有可用于隧道的注册主机名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM