sws: A simple web server for serving directories, similar to weborf.

[ bsd3, program, web ] [ Propose Tags ]

The main drivers for this application were Windows (and Linux) support and security, and to a lesser extent performance. Security is improved over weborf by using Haskell, supporting TLS, and explicitly NOT supporting CGIs of any kind.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.3.0.0, 0.3.0.1, 0.3.1.0, 0.3.1.1, 0.3.1.2, 0.4.0.0, 0.4.0.1, 0.4.1.0, 0.4.2.0, 0.4.3.0, 0.4.5.0, 0.4.6.0, 0.5.0.0, 0.5.0.1
Change log CHANGELOG.md
Dependencies asn1-encoding (>=0.9 && <0.10), asn1-types (>=0.3 && <0.4), base (>=4.6 && <4.8), bytestring (>=0.10 && <0.11), crypto-pubkey (>=0.2 && <0.3), crypto-random (>=0.0 && <0.1), directory (>=1.2 && <1.3), filepath (>=1.3 && <1.4), hourglass (>=0.2 && <0.3), http-types (>=0.8 && <0.9), network (>=2.6 && <2.7), pem (>=0.2 && <0.3), resourcet (>=1.1 && <1.2), transformers (>=0.4 && <0.5), wai (>=3.0 && <3.1), wai-extra (>=3.0.3 && <3.1), wai-middleware-static (>=0.6 && <0.7), warp (>=3.0 && <3.1), warp-tls (>=3.0 && <3.1), x509 (>=1.5 && <1.6) [details]
License BSD-3-Clause
Copyright Copyright (c) 2014 Derek Elkins
Author Derek Elkins
Maintainer derek.a.elkins@gmail.com
Category Web
Source repo head: git clone https://github.com/derekelkins/sws.git
Uploaded by DerekElkins at 2014-12-30T03:56:48Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables sws
Downloads 9642 total (42 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2015-06-08 [all 7 reports]

Readme for sws-0.3.0.1

[back to package description]

Simple Web Server

What it is

sws is a self-contained web server that serves files which runs on Linux, Windows and (untested) Mac OS X. Once built, the executable should have no dependencies, e.g., it does not require OpenSSL. Convenience and security are the main goals. It has no config files, and only a few, if any, easily provided command line parameters should be necessary. If convenience and security conflict, I'm willing to sacrifice a little convenience for security, but only a little. Often such conflicts are largely resolvable. For example, requiring a password and using TLS improve security, but making a password or a certificate are inconvenient, so sws can generate these.

Use-case 1: xkcd scenario

You want to send a large file to someone. You browse to the directory containing it, type "sws", and give them your public IP. They browse to it and download. Maybe they are the ones sending the file, but aren't "technical". You browse to an empty directory, type "sws -w", and give them your public IP. They browse to it and upload.

In reality, you need to figure out what your public IP is and open a port in your firewall. sws will currently use Google's STUN server to attempt to figure out your public IP.

Use-case 2: Client-side code demo/development

You build an unhosted web application or you mock out AJAX responses. You can do some simple testing by running "sws -d". (Admittedly, using a file URI will probably work pretty well too, though maybe not so much for mocked POST requests...) You want to show a friend. Just make that "sws".

What it isn't

This is not an app server. It reads and writes files, and that's all it will ever do. There is no way to add code to it. The Haskell ecosystem has plenty of good web frameworks. This is not one of them. It's an application, not a framework. (Well... you could do something with named pipes and/or interesting file systems... but you really shouldn't.)