两个任意源之间的文件/数据传输
我正在寻找一种简单的方法来实现这种情况:
假设我有两台机器,我想在它们之间共享数据。这些机器的位置/地址可以随时更改。我希望两台机器都能签入中央服务器以宣布它们的可用性。两个系统之一想要从另一个系统中提取文件。我知道我可以让接收器系统向服务器发出请求,然后服务器从源请求文件,拉出它,然后将其提供给请求者。然而,从带宽的角度来看,这似乎效率低下。文件将被传输两次。是否有一个系统可以让源将其直接广播到接收器?
如果系统位于防火墙后面,则无法保证诸如端口转发之类的事情。我不知道有什么办法。
谢谢。
I'm looking for a simple way to implement this scenario:
Say I have two machines I'd like to share data between. The location/addresses of these machines can change at any time. I'd like both machines to check in to a central server to announce their availability. One of the two systems wants to pull a file from the other. I know that I can have the sink system make a request to the server, who then requests the file from the source, pulls it, then feeds it to the requester. However, this seems inefficient from a bandwidth perspective. The file will be transfered twice. Is there a system in place where the source can broadcast it directly to the sink?
Without being able to guarantee things like port forwarding if a system is behind a firewall etc. I don't know of a way.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当机器
A
想要向机器B
发送数据时,A
向中央服务器C
发送请求。C
向B
请求许可。如果接受,C
会将B
的 IP 和端口提供给A
。A
尝试直接连接到B
。如果不成功(即,如果B
位于路由器/防火墙后面),则A
会通知C
失败。然后,C
将A
的IP 和端口提供给B
。B
尝试直接连接到A
(应该能够通过B
的防火墙/路由器)。如果任一连接成功,则A
具有直接连接以将数据发送到B
。如果两个连接均不成功(即,如果A
也位于防火墙/路由器后面),则C
必须充当A< 之间所有传输的代理。 /code> 和
B
。When machine
A
wants to send data to machineB
,A
sends a request to the central serverC
.C
asksB
for permission. If accepted,C
givesB
's IP and port toA
.A
attempts to connect toB
directly. If unsuccessful (ie, ifB
is behind a router/firewall), thenA
notifiesC
of the failure.C
then givesA
's IP and port toB
.B
attempts to connect directly toA
(which should be able to pass throughB
's firewall/router). If either connection is successful, thenA
has a direct connection to send data toB
. If both connections are unsuccessful (ie, ifA
is also behind a firewall/router), thenC
has to act as a proxy for all transfers betweenA
andB
.