{"id":47593129,"url":"https://github.com/douxxtech/nasmserver","last_synced_at":"2026-04-01T17:44:59.991Z","repository":{"id":344698608,"uuid":"1182459704","full_name":"douxxtech/nasmserver","owner":"douxxtech","description":"A HTTP/1.0 server written in NetWide Assembler.","archived":false,"fork":false,"pushed_at":"2026-03-23T21:17:12.000Z","size":220,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-24T18:43:53.627Z","etag":null,"topics":["assembly","netwide-assembler","webserver","x86-64"],"latest_commit_sha":null,"homepage":"https://nasmserver.douxx.tech","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/douxxtech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-15T14:55:10.000Z","updated_at":"2026-03-23T21:15:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/douxxtech/nasmserver","commit_stats":null,"previous_names":["douxxtech/nasmserver"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/douxxtech/nasmserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douxxtech%2Fnasmserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douxxtech%2Fnasmserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douxxtech%2Fnasmserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douxxtech%2Fnasmserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/douxxtech","download_url":"https://codeload.github.com/douxxtech/nasmserver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douxxtech%2Fnasmserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembly","netwide-assembler","webserver","x86-64"],"created_at":"2026-04-01T17:44:59.501Z","updated_at":"2026-04-01T17:44:59.986Z","avatar_url":"https://github.com/douxxtech.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NASMServer\n\nA HTTP/1.0 static file server written in [NetWide Assembler](https://nasm.us/), by [Douxx](https://douxx.tech).  \nRead the [blog article](https://aka.dbo.one/nasmserver)!\n\n\u003e [!CAUTION]\n\u003e **Educational project**: This server likely has more security flaws than there are stars in the universe. It is **not recommended for production use**. Use it to learn, experiment, or have fun.\n\n## How it started\n\nI started learning NASM on a Monday afternoon, because I was bored in my NoSQL class. After a few self-made exercises (parsing args, string processing, etc.), I built a small HTTP client tool, imagine curl, but without the cool stuff. Then during my blockchain class, I started developing this server. The source grew from there.\n\n## What it supports\n\n- HTTP/1.0 `GET` and `HEAD` requests\n- Static file serving with automatic MIME type detection (70+ types)\n- Basic Authentication (`Authorization: Basic`)\n- Custom error pages per status code (`400`, `401`, `403`, `404`, `405`)\n- Configurable `Cache-Control` via `Max-Age` / `Expires` headers\n- `Last-Modified` header based on file mtime\n- Dotfile/dotfolder serving control\n- Concurrent request handling via `fork()`\n- Configurable `Server:` header\n- Per-request logging with timestamps and client IPs\n- Apache-HTTP-Server-like [combined-format](https://en.wikipedia.org/wiki/Common_Log_Format) logging\n- Persistent request logging to file\n\n## What it does NOT support\n\n- HTTP/1.1 (keep-alive, chunked transfer, etc.). Responses are always `HTTP/1.0`\n- HTTPS / TLS, use a reverse proxy (nginx, Caddy) or a Cloudflare tunnel in front\n- Dynamic content: no CGI, no scripting, purely static\n- CRLF line endings in `.env` files: use LF only\n- Range requests (`Range: bytes=...`)\n- Directory listing, directories without an index file return `403`\n- Query string processing, `?foo=bar` is stripped and ignored since it's a static file host\n\n## Usage (from a release)\n\nEach release ships prebuilt bundles for different architectures. The bundles contain everything you need to run NASMServer, including the entry script `nasmserver`, an example config file `env.example`, and a default web directory `www/`.\n\n```bash\n# 1. Download and extract the release\nwget https://github.com/douxxtech/nasmserver/releases/latest/download/nasmserver-linux-x64.zip\nunzip nasmserver-linux-x64.zip -d nasmserver\n\n# 2. Enter the directory\ncd nasmserver\n\n# 3. Read the instructions\ncat instructions.txt\n\n# 4. Copy the example config (optional)\ncp env.example .env\n\n# 5. Run it (defaults to port 8080, document root: ./www or current directory)\n./nasmserver\n\n# Pass a custom config file\n./nasmserver -e /path/to/config.env\n\n# See all supported flags\n./nasmserver -h\n```\n\n\u003e Ports below 1024 require root or `CAP_NET_BIND_SERVICE`. Either run with `sudo`, or set `PORT` to something above 1024 in your `.env`.\n\n### CLI flags\n\n| Flag | Description |\n|---|---|\n| `-h` | Show help and exit |\n| `-v` | Show version and exit |\n| `-e \u003cpath\u003e` | Path to the `.env` config file to load |\n\n\n## Install (from a release)\n\nEach bundle includes an install script that sets up NASMServer system-wide. It can also be used to update an existing install without overwriting your config.\n\n```bash\n# Once inside the extracted bundle (see above)\n./install\n```\n\n## Build from source\n\n**Requirements:** `nasm` `binutils` `patchelf`\n\n```bash\n# Build the x86_64 binary only\nbash buildasm.sh program.asm\n# Output binary: ./program\n\n# Build a full release bundle\nbash .github/scripts/build-bundle.sh \u003cx64|aarch64\u003e\n# Outputs: bundle-\u003carch\u003e/ and nasmserver-linux-\u003carch\u003e.zip\n```\n\nThe entry point is `program.asm`. Macros and utilities live in `macros/`, labels in `labels/`.\n\n## Configuration\n\nCopy `env.example` to `.env` and edit as needed. All keys are optional and defaults apply if a key is missing or the file is not found.\n\n| Key | Default | Description |\n|---|---|---|\n| `BIND_ADDRESS` | `0.0.0.0` | IPv4 address to bind to |\n| `PORT` | `8080` | Port to listen on |\n| `DOCUMENT_ROOT` | `.` | Document root directory, no trailing slash |\n| `INDEX_FILE` | `index.html` | File served when a directory is requested |\n| `LOG_FILE` | *(empty)* | File to write request logs instead of STDOUT |\n| `MAX_AGE` | `600` | Cache expiry offset in seconds for the `Expires:` header. Sets `Pragma: no-cache` if `0` |\n| `AUTH_USER` | *(empty)* | Username for Basic Authentication. Authentication is only enabled when this is set |\n| `AUTH_PASSWORD` | *(empty)* | Password for Basic Authentication. |\n| `AUTH_REALM` | `None` | Realm for Basic Authentication. |\n| `SERVE_DOTS` | `false` | Whether `.dotfiles` and `.dotfolders/` should be served |\n| `MAX_REQUESTS` | `20` | Max simultaneous connections (1–65535) |\n| `SERVER_NAME` | `NASMServer/ver` | Value for the `Server:` response header |\n| `USE_X_REAL_IP` | `false` | Use the `X-Real-Ip` header for logging instead of the remote socket address |\n| `ERRORDOC_400` | *(empty)* | Error page path, relative to `DOCUMENT_ROOT`, must start with `/` |\n| `ERRORDOC_401` | *(empty)* | Same, for 401 |\n| `ERRORDOC_403` | *(empty)* | Same, for 403 |\n| `ERRORDOC_404` | *(empty)* | Same, for 404 |\n| `ERRORDOC_405` | *(empty)* | Same, for 405 |\n\nIf an `ERRORDOC_*` is left empty, the server sends headers only with no body for that error. Nonexistent errordoc files produce a startup warning but are not fatal.\n\n## Dev notes\n\n- The server uses `fork()` per connection, so no threads, no event loop. Each child handles exactly one request, then exits.\n- Zombie reaping happens at the top of the `accept()` loop, so zombies linger until the next incoming connection.\n- Concurrent connections are capped by `MAX_REQUESTS`. If the limit is hit, the connection is dropped and a warning is logged.\n- The request buffer is 8 KB. Requests larger than that are truncated.\n- Path traversal (`..`) is blocked in the path parser. Dotfile access is blocked by default unless `SERVE_DOTS=true`.\n- Startup checks validate `DOCUMENT_ROOT` existence and permissions, and warn on missing errordoc files. A bad `DOCUMENT_ROOT` is fatal.\n- No CRLF support in `.env` files, be sure to use LF line endings only.\n\n## Notes\n\n- HTTP/1.0 only, no TLS (HTTPS can be handled upstream via a reverse proxy or Cloudflare tunnel)\n- Bugs, errors, or issues? Open an [issue](https://github.com/douxxtech/nasmserver/issues/new/)\n\nSee `LICENSE` for usage terms.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouxxtech%2Fnasmserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouxxtech%2Fnasmserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouxxtech%2Fnasmserver/lists"}