如果我想使用 TCP 将二进制文件“binary.bin”(与 NetCat 位于同一目录中)传输到 IP 地址 127.0.0.1 端口 1200,如何使用 NetCat 适用于 Windows?
If I want to transfer a binary file "binary.bin" (located in the same directory as NetCat) to IP address 127.0.0.1 port 1200 using TCP, how do I specify this using NetCat for windows?
发布评论
评论(3)
我找到了解决方案。另外
,如果需要保存响应,那么
I found the solution. Its
In addition, if the response needs to be saved then
如果您想将其从 Linux 发行版发送给任何人(包括 Windows PC),您可以执行以下操作:
然后接收端只需在其 Web 浏览器中浏览到您的 IP 地址并收到下载提示。
不用说,如果您位于路由器后面,则需要转发端口 1200。
If you want to send it from a linux distribution to anybody, including windows PCs you can do something like this:
The receiving end then just needs to browse to your IP Address in his web browser and gets a prompt to download.
Needless to say port 1200 needs to be forwarded if you're behind a router.
我只是想与您分享完整的解决方案,您可以使用该解决方案通过 Netcat 在远程计算机之间的网络公开/提供文件。
我使用这个完美且简单的解决方案以可移植的方式在 Docker 容器之间共享文件,而无需在 Docker 容器中定义 Docker Volume 或安装 ssh。
在源计算机上公开文件的简单 bash 函数:
如果您想多次下载文件,则必须进行无限循环,因为下载后存在
Netcat
。从主脚本中调用 bash 方法以在需要时公开文件:
然后您可以使用简单的
wget
将文件下载到源计算机上:我希望这能帮助您节省一些时间;)
I just want to share with you the complete solution that you can use to expose/make available a file via a network between remote computers with Netcat.
I use this perfect and simple solution to share a file between Docker Containers in a portable way without defining
Docker Volume
or installingssh
in the Docker container.A simple bash function that exposes the file on the source machine:
The endless loop is necessary if you want to download the file more than one time because after the download
Netcat
exists.Call the bash method from your main script to expose the file when you need it:
Then you can use the a simple
wget
to download the file on the source machine:I hope that this will help you to save some time ;)