Http serve using public IP

What is the problem you are having with rclone?

I'm trying to use rclone http serve using my public IP address and want to render it to web browser such that others can view and access the files. But the error I am getting is ->
Failed to http: listen tcp :8081: bind: The requested address is not valid in its context.

I know we can not use the public IP address directly, and I tired port forwarding too. But the result was the same. Can anybody give any leads on how to use http serve with the public IP address.

The same command works completely fine on the local IP address.

thanks!

Run the command 'rclone version' and share the full output of the command.

rclone version
rclone v1.57.0

  • os/version: Microsoft Windows 10 Pro for Workstations 2009 (64 bit)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.17.2
  • go/linking: dynamic
  • go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

local

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone serve http -vv local:folder --addr x.x.x.x:8081

The rclone config contents with secrets removed.

[local]
type = local

A log from the command with the -vv flag

rclone serve http -vv local:folder --addr x.x.x.x --user username --pass pwd
...
11:15:42 Failed to http: listen tcp x.x.x.x:8081: bind: The requested address is not valid in its context

Usually the 0.0.0.0 notation will make applications accept any locally assigned IPv4 address, including loopback, private or public. Try it like 0.0.0.0:8081.

Hi, it works for local only.
But for my use case I need others who are outside my private network to use my public IP address and they should be able to see all the files which I had shared using the serve http command.

I want to use the public IP address in the serve http command so that I can share it to the public, which in turn others can use my public IP address and port to access and view the files.

Any help on this would be great!

As noted above, you need to use --bind 0.0.0.0:8181

If you have a router or something, you need to port forward 8181 to your local IP.

The --bind doesn't seem to work.

C:\rclone> rclone serve -vv http local:C:\rclone --bind 0.0.0.0:8081
2022/02/17 16:47:10 --bind: Failed to parse "0.0.0.0:8081" as IP address: lookup 0.0.0.0:8081: no such host

C:\rclone> rclone serve -vv http local:C:\rclone --addr 0.0.0.0:8081 --bind 0.0.0.0:8081
2022/02/17 17:17:59 --bind: Failed to parse "0.0.0.0:8081" as IP address: lookup 0.0.0.0:8081: no such host

For http server, you would use:

rclone serve http GD: --addr :8912 -vvv

and that opens up 8912 on the machine.

felix@gemini:~$ netstat -an | grep 8912
tcp        0      0 0.0.0.0:8912            0.0.0.0:*               LISTEN

As an example.

      --addr string                            IPaddress:Port or :Port to bind server to (default "127.0.0.1:8080")

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.