• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language
    Clojure
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Zero-configuration command-line async HTTP files server in Clojure. Like Python's SimpleHTTPServer but scalable.

Nasus HTTP Server

A simple zero-configuration command-line HTTP files server. Like Python's SimpleHTTPServer but scalable. Сan easily handle thousands of simultaneous connections.

Implemented in Clojure with Aleph and Netty. Mostly as an example. It's still skillful and handy tho'. There's even nothing wrong with putting it to production.

Usage

Run in the directory you want to serve:

clj -Sdeps '{:deps {nasus {:mvn/version "0.1.7"}}}' -m http.server

Or specify custom port:

clj -Sdeps '{:deps {nasus {:mvn/version "0.1.7"}}}' -m http.server 8001

Features

  • Plain text & HTML directory listings based on "Accept" header
  • Automatic mime-type detection
  • Streaming and chunked encoding for large files
  • Keep-alive and slow requests handling
  • Transparent content compression (gzip, deflate)
  • Cache control and "Last-Modified"
  • CORS headers

In development:

  • Range queries support
  • SSL/TLS
  • List of files & directories to exclude from serving

Flags

  -p, --port <PORT>         8000        Port number
  -b, --bind <IP>           0.0.0.0     Address to bind to
      --dir <PATH>          ./          Directory to serve files
      --auth <USER[:PASSWORD]>          Basic auth
      --no-index                        Disable directory listings
      --no-cache                        Disable cache headers
      --no-compression                  Disable deflate and gzip compression
      --follow-symlink                  Enable symbolic links support
      --include-hidden                  Process hidden files as normal
      --cors                            Support Acccess-Control-* headers, see --cors-* options for more fine-grained control
      --cors-origin                     Acccess-Control-Allow-Origin response header value
      --cors-methods                    Acccess-Control-Allow-Methods response header value
      --cors-allow-headers              Acccess-Control-Allow-Headers response header value
      --index-document-path <PATH>      When requesting "dir/", respond with "dir/<PATH>" instead of a listing
  -h, --help

License

Copyright © 2020 Nasus

Nasus is licensed under the MIT license, available at MIT and also in the LICENSE file.

More Repositories

1

fn.py

Functional programming in Python: implementation of missing features to enjoy FP
Python
3,302
star
2

muse

Clojure library that makes remote data access code elegant and efficient at the same time
Clojure
319
star
3

talks

Talks and materials from different conferences, meetings etc
CSS
205
star
4

quiche4j

QUIC transport protocol and HTTP/3 for Java
Java
75
star
5

pyage2

"Age of Empires II" Learning Environment
Python
42
star
6

elixir-scala

Fancy macro(s) to deal with many nested map/filter calls in Elixir (analog for-yield in Scala)
Elixir
27
star
7

gym-microrts-paper-sb3

RL agent to play μRTS with Stable-Baselines3 and PyTorch
Python
25
star
8

fiberfox

🦊 High-performance DDoS vulnerability testing toolkit. Various L4/7 attack vectors. Async networking, low CPU/RAM consumption.
Python
21
star
9

dataclasses-tensor

Easily serialize dataclasses to and from tensors (PyTorch, NumPy)
Python
16
star
10

riak-pipe-workshop

Code materials for Riak Pipe Workshop
Erlang
16
star
11

camille-sql

Run SQL over your Maven artifacts
Java
11
star
12

finagle-consul

Service discovery for Finagle cluster with Consul. Multi DC support, custom health checks
Scala
11
star
13

gearoscope

Gearman server monitoring and worker management system
JavaScript
10
star
14

hotcode-todo

Real-time users collaboration for TodoMVC
JavaScript
9
star
15

timely0

Minimalistic implementation of Naiad paper "A Timely Dataflow System" in Scala
Scala
8
star
16

async-errors

Code for Kyiv Clojure Meetup talk "Error handling with core.async"
Clojure
7
star
17

car-racing-attention-agent

Reproduce the results of "Neuroevolution of Self-Interpretable Agents" paper
Python
5
star