| AUR: | 32312 |
|---|---|
| Arch Forum Thread: | 85751 |
| Binary Package: | xyne-any/quickserve-2010.08.05.4-1-any.pkg.tar.xz |
| PKGBUILD: | pkgbuilds/quickserve |
| Repos: | [xyne-any] |
| Source Package: | quickserve-2010.08.05.4.tar.gz |
| Taurball: | quickserve.tar.gz |
| Version: | 2010.08.05.4 |
Quickserve is a very simple HTTP server written in Python that is intended for quickly sharing files on an ad-hoc basis. Aside from opening a port in your firewall if you have one, quickserve requires no set-up and should work with no hassle.
Quickserve can serve single files or entire directories by simply passing it paths on the command line. It can also accept a list of files to share with the "--filelist" option. It is even possible to enable uploads using the "--upload" option, which accepts a directory path as its argument.
Your friend has just stopped by for a few minutes to grab a file from you (/home/foo/bar). He's using Windows and you don't have time to fiddle around with Samba shares or netcat or whatever. You just want to let him connect to your computer and grab "bar". All you need to do is run the following command:
quickserve /home/foo/bar
This will start up a server on all interfaces listening on port 8080. If you have a firewall you will have to open port 8080 in this case but that's it. Now your friend can open his web browser (or use "wget" or something similar) and navigate to your IP address on the lan. For example, if your internal IP is 192.168.0.1, then the address would be "http://192.168.0.1:8080/". This page will show a link to "bar" which can then be downloaded. Of course he could have just nativated to "http://192.168.0.1:8080/bar" to begin with, but if you share multiple files then the default page will list them all and you can use tools such as aria2c to grab everything at once.
See "quickserve -h" for options and usage.
When requesting a URL on localhost, Firefox sometimes truncates the path. This means that if you try to navigate to "http://localhost:8080/foo", Firefox might only request "/" instead of "/foo". This bug (feature?) appears to be a consequence of an attempt to prevent malicious requests for local files but I really do understand it or how it work and have given up trying to discover the underlying logic. It seems that sometimes you can bypass it by using a path with a second "/" in it, e.g. "http://localhost:8080/info/" instead of "http://localhost:8080/info", or by placing files in a directory instead of in the root path, but sometimes even that doesn't work.
This only affects Firefox and only applies to localhost. You can bypass it by using "127.0.0.1", by accessing quickserve through a different interface via Firefox or by using a different web browser or tool. If you feel inclined to file a bug on Mozilla's site or if you understand the underlying logic and want to explain it to me, please do.