no-src / gofs

A cross-platform real-time file synchronization tool out of the box based on Golang
Apache License 2.0
460 stars 40 forks source link

Customise the file server port #368

Closed qsk5yrs closed 1 month ago

qsk5yrs commented 1 month ago

Customise the file server port, for example, port 18080, when the client specifies the port to access, it still accesses the default port 443, and prompts a connection timeout when synchronising files.

mstmdev commented 1 month ago

You can use the -server_addr flag to specify the startup port of the file server, and then pass it to the client via the fs_server parameter. The fs_server might be a proxy address of nginx, and the client cannot manually specify the port for the HTTP file server.

Here's an example:

# server
gofs -source="rs://127.0.0.1:8105?mode=server&local_sync_disabled=true&path=./source&fs_server={https://file.demo.com or https://127.0.0.1:18080}" -server_addr=:18080 -dest=./dest -users="gofs|password|rw" -tls_cert_file=cert.pem -tls_key_file=key.pem -push_server -token_secret=mysecret_16bytes

# client
gofs -source="./source" -dest="rs://127.0.0.1:8105?local_sync_disabled=false&path=./dest" -users="gofs|password" -tls_cert_file=cert.pem
qsk5yrs commented 1 month ago

You can use the -server_addr flag to specify the startup port of the file server, and then pass it to the client via the fs_server parameter. The fs_server might be a proxy address of nginx, and the client cannot manually specify the port for the HTTP file server.

Here's an example:

# server
gofs -source="rs://127.0.0.1:8105?mode=server&local_sync_disabled=true&path=./source&fs_server={https://file.demo.com or https://127.0.0.1:18080}" -server_addr=:18080 -dest=./dest -users="gofs|password|rw" -tls_cert_file=cert.pem -tls_key_file=key.pem -push_server -token_secret=mysecret_16bytes

# client
gofs -source="./source" -dest="rs://127.0.0.1:8105?local_sync_disabled=false&path=./dest" -users="gofs|password" -tls_cert_file=cert.pem

Thanks,it works.