{"id":13527857,"url":"https://github.com/watson/reverse-http","last_synced_at":"2025-04-30T13:51:59.792Z","repository":{"id":58927292,"uuid":"55958927","full_name":"watson/reverse-http","owner":"watson","description":"A reverse HTTP client","archived":false,"fork":false,"pushed_at":"2017-05-18T22:44:41.000Z","size":20,"stargazers_count":42,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T07:45:10.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/watson.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}},"created_at":"2016-04-11T09:26:12.000Z","updated_at":"2024-07-03T17:13:16.000Z","dependencies_parsed_at":"2022-09-15T02:23:02.450Z","dependency_job_id":null,"html_url":"https://github.com/watson/reverse-http","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Freverse-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Freverse-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Freverse-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/watson%2Freverse-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/watson","download_url":"https://codeload.github.com/watson/reverse-http/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251714939,"owners_count":21631806,"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":[],"created_at":"2024-08-01T06:02:03.944Z","updated_at":"2025-04-30T13:51:59.744Z","avatar_url":"https://github.com/watson.png","language":"JavaScript","readme":"# reverse-http\n\nCreate a reverse HTTP connection to an HTTP server that supports\n[Reverse HTTP](https://tools.ietf.org/html/draft-lentczner-rhttp-00).\n\n[![Build status](https://travis-ci.org/watson/reverse-http.svg?branch=master)](https://travis-ci.org/watson/reverse-http)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\n## Installation\n\n```\nnpm install reverse-http --save\n```\n\n## Usage\n\n```js\nvar reverseHttp = require('reverse-http')\n\nvar opts = {\n  hostname: 'example.com',\n  path: '/foo'\n}\n\n// Open an HTTP connection to example.com and accept reverse HTTP\n// requests back to this machine\nreverseHttp(opts, function (req, res) {\n  console.log('Incoming request:', req.method, req.url)\n\n  res.writeHead(201, {\n    'Content-Type': 'text/plain',\n    'Content-Length': 11\n  })\n\n  res.end('Hello World')\n})\n```\n\n## API\n\n### `var server = reverseHttp(options[, onRequest])`\n\nCreate a reverse HTTP connection to the HTTP server specificed in\n`options`. Returns an instance of `ReverseServer`. The `ReverseServer`\ninherits from\n[`http.Server`](https://nodejs.org/api/http.html#http_class_http_server)\nand as such exposes the same API.\n\nBesides the regular `options` inherited from\n[`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback)\nthe following special options are also available:\n\n- `tls` - create an https connection (default: `false`)\n- `rejectUnauthorized` - if `true`, the server certificate is verified\n  (default: `true`)\n\nNote that the HTTP method defaults to `POST`.\n\nThe optional `onRequest` callback will be attached as a listener to the\n`request` event.\n\nThe following headers are added by default to the establishing outgoing\nHTTP request:\n\n```http\nUpgrade: PTTH/1.0\nConnection: Upgrade\nContent-Length: 0\n```\n\n### `server.destroy()`\n\nClose the server and destroy the socket.\n\n## License\n\nMIT\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson%2Freverse-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwatson%2Freverse-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwatson%2Freverse-http/lists"}