{"id":13402197,"url":"https://github.com/kzahel/web-server-chrome","last_synced_at":"2026-03-04T07:09:31.528Z","repository":{"id":14283778,"uuid":"16991869","full_name":"kzahel/web-server-chrome","owner":"kzahel","description":"Web Server for Chrome (2026 Relaunch)","archived":false,"fork":false,"pushed_at":"2026-02-27T15:57:55.000Z","size":1747,"stargazers_count":1280,"open_issues_count":132,"forks_count":274,"subscribers_count":71,"default_branch":"main","last_synced_at":"2026-02-27T20:53:01.782Z","etag":null,"topics":["android","http","http-server","ios","tauri","tauri-app","web-server"],"latest_commit_sha":null,"homepage":"https://ok200.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kzahel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2014-02-19T17:07:08.000Z","updated_at":"2026-02-27T15:57:58.000Z","dependencies_parsed_at":"2025-02-28T12:15:11.133Z","dependency_job_id":"45ed08d2-a4c9-46ae-92a6-e3367a60ed36","html_url":"https://github.com/kzahel/web-server-chrome","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kzahel/web-server-chrome","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzahel%2Fweb-server-chrome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzahel%2Fweb-server-chrome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzahel%2Fweb-server-chrome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzahel%2Fweb-server-chrome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kzahel","download_url":"https://codeload.github.com/kzahel/web-server-chrome/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kzahel%2Fweb-server-chrome/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30075425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:31:57.858Z","status":"ssl_error","status_checked_at":"2026-03-04T05:31:38.462Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["android","http","http-server","ios","tauri","tauri-app","web-server"],"created_at":"2024-07-30T19:01:12.792Z","updated_at":"2026-03-04T07:09:31.495Z","avatar_url":"https://github.com/kzahel.png","language":"TypeScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003ca target=\"_blank\" href=\"https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb\"\u003e![Try it now in CWS](https://raw.github.com/GoogleChrome/chrome-app-samples/master/tryitnowbutton.png \"Click here to install this sample from the Chrome Web Store\")\u003c/a\u003e\n\n## Web Server for Chrome\n\nan HTTP web server for Chrome (chrome.sockets)\n\nGet it in the chrome web store:\nhttps://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb\n\nMany people have found the webstore version useful for doing some basic web development as an alternative to python -m SimpleHTTPServer. But it can also be used for quick file sharing over a local network.\n\nFeatures\n- serve local files\n- configure listening port\n- configure listening interface (e.g. localhost or all interfaces)\n- custom http handlers possible\n- websocket support available\n- works nice with chrome.runtime.onSuspend\n- options for autostart, start in background, etc etc.\n- handles range requests, HEAD, etc\n- options for CORS\n- optional PUT, DELETE request (for upload files)\n- sets MIME types\n- can render directory listing\n- See relevant options: https://github.com/kzahel/web-server-chrome/blob/master/polymer-ui/options.js\n\n\nHow to include into your own chrome app\n===\n\nrun minimize.sh to concatenate all the required files together and then include the resulting wsc-chrome.min.js in your project. Here is an example of another project's usage: https://github.com/zebradog/kiosk/blob/f7a398f697edc1c22b90c14f959779f1e850012a/src/js/main.js#L124\n\n### Basic usage:\n\n```\nvar app = new WSC.WebApplication(options)\napp.start( callback )\n```\n\noptions: object, with keys\n- handlers: array of handlers,\n- renderIndex: boolean (whether to render index.html if in directory)\n- optBackground: whether to run even if the window is closed\n- optAutoStart: whether to auto start when chrome starts\n- port: int (port to listen on)\n- See relevant options: https://github.com/kzahel/web-server-chrome/blob/master/polymer-ui/options.js\n\n```\nHandlers\n    var handlers = [\n        ['/favicon.ico',FavIconHandler],\n        ['/stream.*',StreamHandler],\n        ['/static/(.*)',StaticHandler],\n        ['.*', DefaultHandler]\n    ]\n```\n\nhandlers is an array of 2 element arrays where the first item is a regular expression for the URL and the second is the handler class, which should extend WSC.BaseHandler\n\n```\n    function StaticHandler() {\n        this.disk = null\n        chrome.runtime.getPackageDirectoryEntry( function(entry) { this.disk = entry }.bind(this) )\n        WSC.BaseHandler.prototype.constructor.call(this)\n    }\n    var FavIconHandlerprototype = {\n        get: function(path) {\n            // USE HTML5 filesystem operations to read file\n            \n        },\n        onReadFile: function(evt) {\n            if (evt.error) {\n                this.write('disk access error')\n            } else {\n                this.write(evt)\n            }\n        }\n    }\n    _.extend(StaticHandler.prototype,\n             StaticHandlerprototype,\n             WSC.BaseHandler.prototype\n            )\n```\n\n\n\n### Building\n\n```\ncd web-server-chrome\nmkdir assets\ncd makedeps\nnpm install\nnpm run make # this builds the app dependencies such as react and material-ui into a bundle\ncd ../react-ui\nnpm run watch # Press ctrl-c if you just want to build it once.\n# press ctrl-C if you are done editing\ncd ../\nbash package.sh\n```\n\nThis creates package.zip, which can then be distributed.\n\n\n### Where to get it\n\nGet it in the chrome web store:\nhttps://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb\n\nThe default behavior right now is very simple. You choose a directory\nto serve static content. It is now able to stream large files and\nhandle range requests. It also sets mime types correctly.\n\nHere is an example project based on it:\nhttps://chrome.google.com/webstore/detail/flv-player/dhogabmliblgpadclikpkjfnnipeebjm\n\n---\n\nMIT license\n\nI wrote this because the example app provided by google would lock and\nhang and had all sorts of nasty race conditions. Plus it would not\nstream large files or do range requests, HEAD requests, etc, etc.\n\nThe design of this is inspired heavily by to the Python Tornado Web\nlibrary. In this as well as that, you create an \"app\" which registers\nhandlers. Then under the hood it will accept connections, create an\nHTTPConnection object, and that has an associated IOStream object\nwhich handles the nonblocking read/write events for you.\n\n\nSee CREDITS file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkzahel%2Fweb-server-chrome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkzahel%2Fweb-server-chrome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkzahel%2Fweb-server-chrome/lists"}