aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/http.exports.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-01Bundle and minify `.exports.js` files. (#3036)Gravatar dave caruso 1-1814/+0
* move all exports.js into src/js * finalize the sort of this * and it works * add test.ts to gitignore * okay * convert some to ts just to show * finish up * fixup makefile * minify syntax in dev * finish rebase * dont minify all modules * merge * finish rebase merge * flaky test that hangs
2023-05-22[node:http] Fix return type for `getHeader()` (#3007)Gravatar Jarred Sumner 1-6/+11
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-22443 should default to https when no protocol is informed (#3008)Gravatar Ciro Spaciari 1-1/+10
2023-05-21fix(tls.connect) fix SNI on tls sockets and also servername (mongodb) (#2934)Gravatar Ciro Spaciari 1-21/+109
* fixes SNI on tls sockets and also servername * πŸ’… * πŸ’… * add support for https and wss * fix bun types * support Bun.file on ca, key and cert * πŸ’… * add setTimeout (makes fastify run) * fix httpVersion * fix WebSocketServer and add listen event * fix ws exports and http listening * fix default import * bump uws * add nodebuffer compatibility * fix drain and allow more passing tests to run * fix enqueud messages * default to arraybuffer * fix constructor binaryType * fmt * fixup * skip some tests * skip more * skip fault tests * reuse encoder instance * fix handshake WS Client * temporary revert handshake fix * fix handshake * disable all socket.io test temp * fixup * add back socket.io tests * use node_fs to read cert, ca and key on server.zig * throw the error returned by NodeFS * πŸ’…
2023-05-18Fixes #2924Gravatar Jarred Sumner 1-0/+8
2023-05-16feat(WebSocketServer) WebSocketServer wrapper + socket.io initial support ↡Gravatar Ciro Spaciari 1-4/+44
(#2880) * WebSocketServer wrapper + socket.io initial support * fix up backpressure * fix up backpressure * fix http address * add socket.io tests * add closing tests * add connection state recovery tests for socket.io * add handshake test * add middeware tests for socket.io * added socket.io socket middleware tests * add more socket.io test comment/skip hang tests * add pending package for tests * add server attachment servers for socket.io * add utility-methods tests for socket.io * rename * rename * add messaging-many socket.io tests * add namespaces tests to socket.io * skip some tests * fmt * add packages to general package.json
2023-05-12proper stub for sockets (#2868)Gravatar Ciro Spaciari 1-8/+80
2023-05-11call stop before emitGravatar Jarred Sumner 1-1/+1
2023-05-11fixupGravatar Jarred Sumner 1-1/+2
2023-05-11[node:http] handle errors generated by fetchGravatar Jarred Sumner 1-28/+33
2023-05-11[node:http] Fix `close()` to accept a callback and implement ↡Gravatar Jarred Sumner 1-5/+23
`closeAllConnections`
2023-05-11fix redirect: \'manual\' and setTimeout on node:http request (#2848)Gravatar Ciro Spaciari 1-4/+20
2023-05-04Revert "Add `setNoDelay`"Gravatar Jarred Sumner 1-4/+2
This reverts commit 8b6dd0c7e1c78a37da693dc216b18f32caa61927.
2023-05-04Add `setNoDelay`Gravatar Jarred Sumner 1-2/+4
2023-05-04Add no-op for ClientRequest.{setNoDelay,setTimeout}Gravatar Ashcon Partovi 1-0/+9
2023-04-17Get axios working (#2673)Gravatar Jarred Sumner 1-14/+64
* Revive node:http tests * Fix a couple bugs in node:http * possibly breaking: use `"browser"` exports condition last * Make URL validation error better --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-26fix https default port on http.request (#2490)Gravatar Ciro Spaciari 1-1/+1
* fix https default port on http.request * Update http.exports.js
2023-03-14Fix `node:https` being readonlyGravatar Jarred Sumner 1-8/+2
2023-03-03Improve types for `node:http` (#2284)Gravatar Colin McDonnell 1-0/+4
* Document node:http * Fix test * Fix default * Fix default
2023-03-03Fix http server req url (#2285)Gravatar zhiyuan 1-1/+1
* fix: http url add search query * fix: add tests
2023-03-01fix(node:http): match Node `http.request()` GET/HEAD w/ body (#2262)Gravatar Derrick Farris 1-2/+6
2023-03-01Add a test for https request in node:httpGravatar Jarred Sumner 1-17/+12
2023-03-01fix(node:http/https): fix passing `URL` objs to `http.request`(#2253) (#2258)Gravatar Derrick Farris 1-15/+16
* fix(node:http/https): fix passing `URL` objs to `http.request`(#2253) * fix(node:http): hoist debug env var * fix(node:http): make body `undefined` when falsy
2023-02-27use abort signal on http.ClientRequest (#2222)Gravatar Ciro Spaciari 1-18/+26
* use abort signal on http.ClientRequest * fix edge case and add test
2023-02-27add signal on http.Server.listen (#2223)Gravatar Ciro Spaciari 1-0/+6
* add signal on http.Server.listen * actual call close instead of just stopping the server
2023-02-12Return server on listen (#2057)Gravatar MichaΕ‚ Warda 1-0/+2
2023-02-01feat: add `http.request` (#1959)Gravatar Derrick Farris 1-54/+807
* fix(node-test-helpers): make sure to call done with any Errors thrown from wrapped fn * feat(node:http): add http.request, patch some missing apis for IncomingRequest, etc. * fix(node:http): FakeSocket -> Socket * refactor(node:http): only save type from IncomingMessage.options for now * fix(node:http): remove unnecessary check for UInt8Array * perf(node:http): globalThis.fetch -> var fetch = Bun.fetch * todo(node:http): add notes about handling abort/timeout w/ AbortSignal * refactor(node:http): standardize on FakeSocket and this.#fakeSocket * fix(node:http): fix headers getter * fix(node:http): remove _headers * perf(node:http): make http headers lazy * fix(node:http): return bool from keepSocketAlive
2023-01-31Re-run prettier after changesGravatar Jarred Sumner 1-20/+13
2023-01-27fix(Express.js) Express.js try to use function as hostname (#1914)Gravatar Ciro Spaciari 1-3/+2
2023-01-22Update http.exports.jsGravatar Jarred Sumner 1-1/+1
2023-01-22[node:http] Add `address()` and fix callback / options parsingGravatar Jarred Sumner 1-9/+29
2022-12-28Upgrade to latest Zig (#1610)Gravatar Jarred Sumner 1-11/+23
* @min and @max * builtins and some trivial ones * Most of them * more * more! * More Progress * wip * Update tagged_pointer.zig * Update http_client_async.zig * Most of the iterable dir changes * alright * Remove usages of deprecated formatters * :camera: * fmt * Update shimmer.zig * wip * wip * wip * progress * more * Latest * stuck on error * latest * workaround stage2 * wip * Update string_immutable.zig * wip * Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings * Fix build errors * Fixup most of the test failures * Fix `make headers` * Fix "outside package path" error * Fixup aligned alloc * Add missing file * linux * More linux fixes * use latest peechy * Fix transpiler test failure * Forgot about these * Fixup test failure * Update node-timers.test.ts * [node:htt] Fix `undefined is not an object` error Fixes https://github.com/oven-sh/bun/issues/1618 * Update http.exports.js * Make this test less flaky * fix hashes * Fix hex formatting and zls issues * Download zig version * Update Dockerfile * Update Dockerfile * Update uws * Update Dockerfile * Set llvm version * Update README.md * Update uws * Update Dockerfile * Update io_linux.zig * Update bun.zig * Log output * workaround strange @cInclude error * Make ffi tests better * Don't use cImport * Update c.zig * Update c-bindings.cpp * call setOutputDir * Update Dockerfile * Use a longer name * latest * Update serve.test.ts Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-11-16Make `node:http`.createServer work betterGravatar Jarred Sumner 1-36/+81
2022-11-09Add bun-types, add typechecking, add `child_process` types (#1475)Gravatar Colin McDonnell 1-5/+5
* Add bun-types to packages * Improve typing * Fix types in tests * Fix dts tests * Run formatter * Fix all type errors * Add strict mode, fix type errors * Add ffi changes * Move workflows to root * Add workflows * Remove labeler * Add child_process types * Fix synthetic defaults issue * Remove docs * Move scripts * Run prettier * Include examples in typechecking * captureStackTrace types * moved captureStackTrace types to globals * Address reviews Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2022-10-05Temporary hack so `res.socket` in node:http doesn't throwGravatar Jarred Sumner 1-1/+7
2022-08-22woopsGravatar Jarred Sumner 1-1/+0
2022-08-22[node:http] speed up assigning headersGravatar Jarred Sumner 1-55/+41
2022-08-2238% faster `node:http`Gravatar Jarred Sumner 1-77/+203
Before: ```fish ❯ oha http://localhost:3000 -z 2s -c 20 Summary: Success rate: 1.0000 Total: 2.0006 secs Slowest: 0.0095 secs Fastest: 0.0000 secs Average: 0.0003 secs Requests/sec: 69521.0420 ``` After: ``` ❯ oha http://localhost:3000 -z 2s -c 20 Summary: Success rate: 1.0000 Total: 2.0005 secs Slowest: 0.0063 secs Fastest: 0.0000 secs Average: 0.0002 secs Requests/sec: 109119.8614 ``` Code ``` const http = require("http"); const hostname = "127.0.0.1"; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader("Content-Type", "text/plain"); res.end("Hello World!"); }); server.listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`); }); ```
2022-08-03use import.meta.require instead of import (#973)Gravatar Zilin Zhu 1-2/+2
2022-07-13add node:http Server polyfill (#572)Gravatar evan 1-0/+540
* node:http polyfill * remove @ts-ignore * reuse emitter instance * requested changes * cleanup Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>