{"id":16334961,"url":"https://github.com/flexiondotorg/nullserv","last_synced_at":"2025-07-13T16:06:10.073Z","repository":{"id":144715519,"uuid":"157375666","full_name":"flexiondotorg/nullserv","owner":"flexiondotorg","description":"A minimal webserver that serves up null content","archived":false,"fork":false,"pushed_at":"2018-11-13T12:19:32.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T09:45:50.995Z","etag":null,"topics":["pixelserv"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flexiondotorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2018-11-13T12:19:21.000Z","updated_at":"2024-11-14T18:40:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"af42fa72-abd2-4c11-9f12-93725b9279b8","html_url":"https://github.com/flexiondotorg/nullserv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flexiondotorg/nullserv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexiondotorg%2Fnullserv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexiondotorg%2Fnullserv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexiondotorg%2Fnullserv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexiondotorg%2Fnullserv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexiondotorg","download_url":"https://codeload.github.com/flexiondotorg/nullserv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexiondotorg%2Fnullserv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265167532,"owners_count":23721461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["pixelserv"],"created_at":"2024-10-10T23:39:43.403Z","updated_at":"2025-07-13T16:06:10.046Z","avatar_url":"https://github.com/flexiondotorg.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nI live in an area where reliable DSL is not available, therefore I access the\nInternet at home using 3G mobile broadband and short wave radio. However, my 3G\nmobile broadband contract is limited to 15GB of bandwidth per month, if I exceed\nthat limit then I start incurring additional charges which can mount up very\nquickly.\n\n`nullserv` is a minimal webserver. It's only purpose is to serve up null content.\n`nullserv` was inspired by [pixelserv](http://proxytunnel.sourceforge.net/pixelserv.php)\nwhich serves a 1x1 pixel transparent `.gif`. `nullserv` expands on this idea by\nserving up null `.html`, `.js`, `.css`, `.php`, `.cgi`, `.pl`, `.asp`, `.aspx`,\n`.txt`, `.gif`, `.png`, `.jpeg` and `.swf` files.\n\nUsing some creative firewalling (netfilter/iptables) rules or local DNS you can\nredirect some requests (for adverts for example) to `nullserv`, thus saving\nbandwidth :-)\n\n`nullserv` is heavily based on `in.www` which is part of the excellent\n[inetdextra](http://inetdxtra.sourceforge.net/) package. The null `.swf`\nis compiled from `swfdec_test_initialize.as` which is part of\n[swfdec](http://swfdec.freedesktop.org) 0.9.2.\n\nI developed `nullserv` on [Ubuntu](http://www.ubuntu.com) Lucid 10.04 LTS and\ndeployed it on a NSLU2 running [Debian](http://www.debian.org) Lenny.\n\n# Install\n\n    make\n    sudo make install\n\n# Requirements\n\n  * inetd (or similar).\n\n# Usage\n\nCurrently, I'm using `dnsmasq` on a [Gargoyle](http://www.gargoyle-router.com/)\nrouter to redirect ad-server IP addresses to `nullserv` running on an embedded Debian\nSqueeze box. Gargoyle is based on OpenWRT, so this technique should also work with\nOpenWRT.\n\n## Debian Squeeze\n\nInstall `git` and the compiler toolchain.\n\n    sudo apt-get install build-essential git-core\n\nCompile and install `nullserv`\n\n    git clone https://github.com/flexiondotorg/nullserv.git\n    cd nullserv\n    make\n    sudo make install\n\nInstall OpenBSD inetd.\n\n    sudo apt-get install openbsd-inetd\n\nAdd the following to `/etc/inetd.conf`\n\n    www  stream  tcp  nowait  nobody  /usr/sbin/tcpd  /usr/bin/nullserv\n\nRestart `inetd.conf`.\n\n    sudo /etc/init.d/openbsd-inetd restart\n\nSome ads are served via https, we can use `stunnel` to forward https \nconnections to `nullserv`.\n\nInstall `stunnel`\n\n    sudo apt-get install stunnel\n\nCreate SSL certificate and a key.\n\n    sudo openssl req -new -nodes -x509 -out /etc/ssl/certs/stunnel.pem -keyout /etc/ssl/certs/stunnel.pem\n\nEnable the `[https]` section in `/etc/stunnel.conf`, I also disable the `[pop3s]`,\n`[imaps]` and `[ssmtp]` as I don't require them.\n\n    [https]\n    accept  = 443\n    connect = 80\n    TIMEOUTclose = 0\n\nEnable `stunnel` in `/etc/default/stunnel4`. Find `ENABLED` and set it to `1`.\n\n    ENABLED=1\n\nStart `stunnel`.\n\n    sudo /etc/init.d/stunnel4 start\n\nOpen a web browser and request anything you like from http://192.168.2.1 or\nwhatever the IP address is the host where `nullserv` is installed. If you\nrequest a file type that is not recognised by `nullserv` it with send back a 0\nbyte response of `Content-Type: text/plain`.\n\nRun `contrib/adaway.sh` and then `scp` the generated `adaway.txt` to `/etc/` \non your Gargoyle/OpenWRT router.\n\n  cd contrib\n  ./adaway.sh\n  scp adaway.txt root@192.168.2.1:/etc/  \n\n## Gargoyle/OpenWRT\n\nAdd the following to `/etc/config/dhcp` under the `config dnsmasq` section.\n\n   list addnhosts '/etc/adaway.txt'\n   \nRestart `dnsmasq`\n\n    /etc/init.d/dnsmasq restart\n\nYou should now find that ads are blocked and replaced with null content.\nYou can do lots more with dnasmasq on Gargoyle/OpenWRT, see the Wiki:\n\n  * \u003chttp://wiki.openwrt.org/doc/uci/dhcp\u003e\n\n# Changes\n\n## v0.3 2013, 29th May.\n\n  * Merged fixes and improvements contributed by Ben Shadwick.\n  * Updated documentation.\n\n## v0.2 2010, 16th September.\n\n  * Added optional logging.\n\n## v0.1 2010, 15th September.\n\n  * Initial release\n\n# Known Limitations\n\n  * I am not a C programmer ;-)\n\n# To Do\n\n  * Document `dnsmasq` and `in.dns` configurations to compliment `nullserv`.\n\n# Source Code\n\nYou can grab the source from Launchpad. Contributions are welcome :-)\n\n  * https://github.com/flexiondotorg/nullserv\n\n# License\n\nA minimal webserver for serving up null content.\nCopyright (c) 2013 Flexion.Org, http://flexion.org/\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexiondotorg%2Fnullserv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexiondotorg%2Fnullserv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexiondotorg%2Fnullserv/lists"}