Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何连接到服务器的rclone rcd #32

Open
Nelocompne opened this issue Aug 9, 2022 · 6 comments
Open

如何连接到服务器的rclone rcd #32

Nelocompne opened this issue Aug 9, 2022 · 6 comments

Comments

@Nelocompne
Copy link

我在VPS上执行

rclone rcd \
--rc-user=USER --rc-pass=PASSWORD \
--rc-allow-origin="https://elonh.github.io"

然后在我的电脑浏览器上访问 https://elonh.github.io/RcloneNg ,Manage中输入 vpsIP:5572 却不能连接到远程控制。
于是我试图用frp将vps的5572端口,转发到我电脑的localhost:5572,然后再Manage中输入localhost:5572 后,成功连接到了VPS上的远程控制。

我想知道为什么不能直接通过服务器IP来管理连接到rclone的远程控制,我该如何解决它?这是rclone本身的问题?还是rcloneNg存在的一个缺陷?

@ElonH
Copy link
Owner

ElonH commented Aug 9, 2022

Rclone 默认使用localhost

使用--rc-addr=IP 修改绑定的地址

但不建议直接暴露在公网。非要这么做,最好加上tls

https://rclone.org/rc/#rc-addr-ip

@Nelocompne
Copy link
Author

我试着用服务器公网IP在参数中添加--rc-addr=IP:port
然后rclone返回了一个错误并无法启动:Failed to start remote control: start server failed: listen tcp [MyServerI]:5572 bind: cannot assign requested address

@ElonH
Copy link
Owner

ElonH commented Aug 10, 2022

@Nelocompne0.0.0.0 试试

@Nelocompne
Copy link
Author

Nelocompne commented Aug 10, 2022

我使用了--rc-addr=0.0.0.0:port后,rclone确实工作了,但是在rcloneNg中仍然无法连接。

首先我认为参数--rc-addr=无论是0.0.0.0还是127.0.0.1localhost,效果都是一样的(我把这些参数都试了一遍),都会在服务器公网IP上开放。

为此我做了这样的POST测试(bash下):

请求来源 请求IP 响应
服务端公网IP 服务端IP HTTP/1.1 200 OK
frp将服务端转发到本地 127.0.0.1 HTTP/1.1 200 OK

浏览器的rcloneNg中,rcloneNg向http://127.0.0.1:5572/rc/noopauth发起请求以获得响应:

请求来源 请求IP 响应 rcloneNg连接状态
服务端公网IP 服务端IP 空值 无法连接
frp将服务端转发到本地 127.0.0.1 HTTP/1.1 200 OK 连接正常

无论如何,我发现rcloneNg,也就是浏览器下,只对127.0.0.1发出的请求有响应,对其他都没有。

@ElonH
Copy link
Owner

ElonH commented Aug 10, 2022

@Nelocompne

有没有添加新的配置?
默认配置是 localhost的ip

你需要点右上角添加一个新的配置
https://elonh.github.io/RcloneNg/#/pages/user

IMG_20220810_203350.jpg

https://elonh.github.io/RcloneNg/#/pages/user/add

IMG_20220810_203712.jpg

@Nelocompne
Copy link
Author

我会使用Manage管理配置,使用上我没有任何问题,谢谢您的提醒。
如果您有VPS服务器的话,可以自己尝试在服务器运行rclone然后用rcloneNg连接看看结果。

image通过公网IP连接失败案例

image通过frp转发连接成功案例

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants