{"id":14954692,"url":"https://github.com/meteor/cordova-httpd","last_synced_at":"2026-01-11T11:03:35.357Z","repository":{"id":20542249,"uuid":"23821731","full_name":"meteor/cordova-httpd","owner":"meteor","description":"CorHttpd is a plugin to embed a tiny web server into Cordova","archived":false,"fork":true,"pushed_at":"2014-09-25T06:35:48.000Z","size":496,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-10-04T02:58:05.227Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"floatinghotpot/cordova-httpd","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meteor.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}},"created_at":"2014-09-09T06:17:12.000Z","updated_at":"2023-08-20T11:24:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meteor/cordova-httpd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/meteor/cordova-httpd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteor%2Fcordova-httpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteor%2Fcordova-httpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteor%2Fcordova-httpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteor%2Fcordova-httpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meteor","download_url":"https://codeload.github.com/meteor/cordova-httpd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteor%2Fcordova-httpd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28301383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T08:21:30.231Z","status":"ssl_error","status_checked_at":"2026-01-11T08:21:26.882Z","response_time":60,"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":[],"created_at":"2024-09-24T13:04:51.100Z","updated_at":"2026-01-11T11:03:35.324Z","avatar_url":"https://github.com/meteor.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CorHttpd: embeded httpd for cordova ##\n\nSupported platform:\n* iOS\n* Android\n\nYou can browse (locally or remotely) to access files in android/ios phone/pad:\n\n* browse the files in mobile device with a browser in PC.\n* copy files from mobile device to PC quickly, just with Wifi.\n* use cordova webview to access the assets/www/ content with http protocol.\n\nWhy http access is good?\n\n* Use wifi instead of cable, more convenient.\n* For security reason, browser does not support local AJAX calls. It's big bottle neck to deploy HTML5 games to Cordova platform. \n* The most popular phaser.js game engine, a httpd is always required, as it use AJAX to load resource. \n\n## How to use CorHttpd? ##\n\nAdd the plugin to your cordova project:\n\n    cordova plugin add https://github.com/floatinghotpot/cordova-httpd.git\n\nQuick start, copy the demo files, and just build to play.\n\n    cp -r plugins/com.rjfun.cordova.httpd/test/* www/\n    \n## Javascript APIs ##\n\n```javascript\n\nstartServer( options, success_callback, error_callback );\n\nstopServer( success_callback, error_callback );\n\ngetURL( success_callback, error_callback );\n\ngetLocalPath( success_callback, error_callback );\n```\n\nExample code: (read the comments)\n\n```javascript\n    var httpd = null;\n    function onDeviceReady() {\n        httpd = ( cordova \u0026\u0026 cordova.plugins \u0026\u0026 cordova.plugins.CorHttpd ) ? cordova.plugins.CorHttpd : null;\n    }\n    function updateStatus() {\n    \tdocument.getElementById('location').innerHTML = \"document.location.href: \" + document.location.href;\n    \tif( httpd ) {\n    \t  /* use this function to get status of httpd\n    \t  * if server is up, it will return http://\u003cserver's ip\u003e:port/\n    \t  * if server is down, it will return empty string \"\"\n    \t  */\n    \t\thttpd.getURL(function(url){\n    \t\t\tif(url.length \u003e 0) {\n    \t\t\t\tdocument.getElementById('url').innerHTML = \"server is up: \u003ca href='\" + url + \"' target='_blank'\u003e\" + url + \"\u003c/a\u003e\";\n    \t\t\t} else {\n    \t\t\t\tdocument.getElementById('url').innerHTML = \"server is down.\";\n    \t\t\t}\n    \t\t});\n    \t\t// call this function to retrieve the local path of the www root dir\n    \t\thttpd.getLocalPath(function(path){\n    \t\t\tdocument.getElementById('localpath').innerHTML = \"\u003cbr/\u003elocalPath: \" + path;\n        \t});\n    \t} else {\n    \t\talert('CorHttpd plugin not available/ready.');\n    \t}\n    }\n    function startServer( wwwroot ) {\n    \tif ( httpd ) {\n    \t    // before start, check whether its up or not\n    \t    httpd.getURL(function(url){\n    \t    \tif(url.length \u003e 0) {\n    \t    \t\tdocument.getElementById('url').innerHTML = \"server is up: \u003ca href='\" + url + \"' target='_blank'\u003e\" + url + \"\u003c/a\u003e\";\n\t    \t    } else {\n\t    \t        /* wwwroot is the root dir of web server, it can be absolute or relative path\n\t    \t        * if a relative path is given, it will be relative to cordova assets/www/ in APK.\n\t    \t        * \"\", by default, it will point to cordova assets/www/, it's good to use 'htdocs' for 'www/htdocs'\n\t    \t        * if a absolute path is given, it will access file system.\n\t    \t        * \"/\", set the root dir as the www root, it maybe a security issue, but very powerful to browse all dir\n\t    \t        */\n    \t    \t    httpd.startServer({\n    \t    \t    \t'www_root' : wwwroot,\n    \t    \t    \t'port' : 8080\n    \t    \t    }, function( url ){\n    \t    \t      // if server is up, it will return the url of http://\u003cserver ip\u003e:port/\n    \t    \t      // the ip is the active network connection\n    \t    \t      // if no wifi or no cell, \"127.0.0.1\" will be returned.\n        \t    \t\tdocument.getElementById('url').innerHTML = \"server is started: \u003ca href='\" + url + \"' target='_blank'\u003e\" + url + \"\u003c/a\u003e\";\n    \t    \t    }, function( error ){\n    \t    \t    \tdocument.getElementById('url').innerHTML = 'failed to start server: ' + error;\n    \t    \t    });\n    \t    \t}\n    \t    \t\n    \t    });\n    \t} else {\n    \t\talert('CorHttpd plugin not available/ready.');\n    \t}\n    }\n    function stopServer() {\n    \tif ( httpd ) {\n    \t    // call this API to stop web server\n    \t    httpd.stopServer(function(){\n    \t    \tdocument.getElementById('url').innerHTML = 'server is stopped.';\n    \t    },function( error ){\n    \t    \tdocument.getElementById('url').innerHTML = 'failed to stop server' + error;\n    \t    });\n    \t} else {\n    \t\talert('CorHttpd plugin not available/ready.');\n    \t}\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeteor%2Fcordova-httpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeteor%2Fcordova-httpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeteor%2Fcordova-httpd/lists"}