在Ubuntu中将文件传输到Ubuntu或Mac上的最快方法到同一网络上的Android
#node #ubuntu #macos #apple

安装

http-server
npm install --global http-server

打开CMD,输入此

http-server
它返回

Starting up http-server, serving ./

http-server version: 14.1.1

http-server settings: 
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://127.0.0.1:8080
  http://192.168.0.116:8080
Hit CTRL-C to stop the server

在其他笔记本电脑开放式镀铬中,键入此
http://192.168.0.116:8080

并开始下载

在Mac中

开放终端,导航至下载文件夹

sh cd Downloads

键入此命令

http-server ./ -p 1313

./特殊将仅服务于下载文件夹中的内容

-p是端口

Starting up http-server, serving ./

http-server version: 14.1.1

http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://127.0.0.1:1313
  http://192.168.0.108:1313
Hit CTRL-C to stop the server

在您的Android中,打开Chrome
输入URL
http://192.168.0.108:1313

选择文件,它将开始下载
in Android mobile