{"id":41264,"library":"http-node","title":"http-node","description":"A standalone repackaging of Node.js's built-in http module (version v6.3.0) as an npm package. It provides the original Node.js HTTP implementation, not a browser shim, and depends on the net module (e.g., chrome-net for Chrome Apps). Useful for running Node.js HTTP code on non-Node.js JavaScript platforms with TCP socket support. Currently at version 1.2.0, with no recent updates; considered stable but outdated.","status":"maintenance","version":"1.2.0","language":"javascript","source_language":"en","source_url":"git://github.com/jscissr/http-node","tags":["javascript"],"install":[{"cmd":"npm install http-node","lang":"bash","label":"npm"},{"cmd":"yarn add http-node","lang":"bash","label":"yarn"},{"cmd":"pnpm add http-node","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for TCP sockets; must be provided by the environment (e.g., chrome-net)","package":"net","optional":false},{"reason":"Replaces native http_parser for cross-platform parsing","package":"http-parser-js","optional":false},{"reason":"Used for deprecation warnings as a replacement for internal/util","package":"util","optional":false}],"imports":[{"note":"Replace Node.js built-in http module by requiring 'http-node' and aliasing builtins in browserify.","wrong":"const http = require('http');","symbol":"http","correct":"const http = require('http-node');"},{"note":"ESM import works if package supports (check module field). Default export mirrors Node.js http module.","wrong":"import http from 'http';","symbol":"default","correct":"import http from 'http-node';"},{"note":"Use http-node to access createServer or other exports.","wrong":"const { createServer } = require('http');","symbol":"createServer","correct":"const server = require('http-node').createServer();"}],"quickstart":{"code":"const http = require('http-node');\nconst net = require('net'); // must provide a net module (e.g., chrome-net)\n// Example: create a simple server (requires net with TCP support)\nconst server = http.createServer((req, res) => {\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('Hello World\\n');\n});\nserver.listen(8080, () => {\n  console.log('Server listening on port 8080');\n});","lang":"javascript","description":"Demonstrates requiring http-node and creating a basic HTTP server with a custom net module."},"warnings":[{"fix":"Provide a compatible net module, like chrome-net for Chrome Apps, or use browserify aliases.","message":"Requires a net module (e.g., chrome-net) that provides TCP sockets; does not work in browser or plain Node.js without custom net.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure http-parser-js is available or pin to a version that supports your runtime.","message":"Uses http-parser-js (CJS) which may cause compatibility issues in ESM environments.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using a more up-to-date standalone HTTP implementation or native Node.js.","message":"Based on Node.js v6.3.0; missing features and fixes from newer Node.js versions (e.g., http2, improved performance).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use browserify JS API to alias 'http' to 'http-node' as shown in README.","message":"The built-in Node.js http module cannot be overridden globally; must be used via browserify custom builtins.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Tracing functions will silently do nothing; this may hide issues.","message":"Comments in code mention DTRACE_HTTP_*, LTTNG_HTTP_*, COUNTER_HTTP_* which are stubbed out; no tracing support.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.2.0':62 'app':44 'browser':30 'built':11 'built-in':10 'chrome':40,43 'chrome-net':39 'code':50 'consid':67 'current':59 'depend':33 'e.g':38 'http':2,13,26,49 'http-node':1 'implement':27 'javascript':53,71 'modul':14,37 'net':36,41 'node':3 'node.js':8,25,48 'non-node.js':52 'npm':19 'origin':24 'outdat':70 'packag':20 'platform':54 'provid':22 'recent':65 'repackag':6 'run':47 'shim':31 'socket':57 'stabl':68 'standalon':5 'support':58 'tcp':56 'updat':66 'use':45 'v6.3.0':16 'version':15,61","created_at":"2026-06-04T18:51:33.997820+00:00","updated_at":"2026-06-04T18:51:33.997820+00:00","problems":[{"fix":"Install and alias a net implementation (e.g., chrome-net) and provide it via browserify: require('chrome-net') and alias 'net' in browserify config.","cause":"http-node requires a net module that is not present in the environment (e.g., browser or custom runtime).","error":"Error: Cannot find module 'net'"},{"fix":"Use `const http = require('http-node');` (not `require('http')`) and ensure browserify builtins alias is set correctly.","cause":"Incorrect import or module not properly aliased; the default export may not include createServer if not using the correct require path.","error":"TypeError: http.createServer is not a function"},{"fix":"Use `require('http-node')` instead of `import` or add a bundler like browserify with proper configuration.","cause":"Package is CommonJS-only; using ESM import without a bundler or Node.js experimental modules may fail.","error":"SyntaxError: Unexpected token import"},{"fix":"Ensure http-node is fully aliased and all dependencies (http-parser-js, net) are correctly resolved. Use require.resolve('http-node') for the path.","cause":"http-node internally requires other http-node modules but the builtins alias isn't applied recursively or the require paths are wrong.","error":"Error: Module not found: 'http' in ./node_modules/http-node/lib/request.js"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/jscissr/http-node#readme","github":"git://github.com/jscissr/http-node","docs":null,"changelog":null,"pypi":null,"npm":"http-node","openapi_spec":null,"status_page":null,"smithery":null,"categories":["networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}