Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http.Server.listen(undefined) uses 3000 #12182

Open
adraffy opened this issue Jun 26, 2024 · 1 comment · May be fixed by #12201
Open

http.Server.listen(undefined) uses 3000 #12182

adraffy opened this issue Jun 26, 2024 · 1 comment · May be fixed by #12201
Labels
bug Something isn't working good first issue Something that would be good for new contributors node:http

Comments

@adraffy
Copy link

adraffy commented Jun 26, 2024

What version of Bun is running?

1.1.12

What platform is your computer?

Darwin 23.1.0 x86_64 i386

What steps can reproduce the bug?

import {createServer} from 'http';
let h = createServer(() => {});
h.listen(undefined, () => {
	console.log(h.address());
});

What is the expected behavior?

random open port

What do you see instead?

port 3000

Additional information

No response

@adraffy adraffy added bug Something isn't working needs triage labels Jun 26, 2024
@paperdave paperdave added the good first issue Something that would be good for new contributors label Jun 27, 2024
@paperdave
Copy link
Collaborator

location of bug: src/js/node/http.ts line 529. node:http uses bun.serve and it defaults to port 3000 instead of random.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Something that would be good for new contributors node:http
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants