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

--allow-net=:8080 broken #6685

Closed
brandonkal opened this issue Jul 8, 2020 · 6 comments
Closed

--allow-net=:8080 broken #6685

brandonkal opened this issue Jul 8, 2020 · 6 comments
Labels
bug Something isn't working correctly cli related to cli/ dir good first issue Good for newcomers

Comments

@brandonkal
Copy link
Contributor

If any code uses shorthand notation:

import { serve } from "https://deno.land/std/http/server.ts"
const PORT = 8080
serve(`:${PORT}`)

then any variant of

deno run --allow-net=:8080 server.ts
deno run --allow-net=localhost:8080 server.ts
deno run --allow-net=0.0.0.0:8080 server.ts
deno run --allow-net=127.0.0.1:8080 server.ts

fails.

Unfortunately, a lot of libraries in x use this pattern which makes locking down permissions impossible without forking all those libraries.

@ry ry added bug Something isn't working correctly cli related to cli/ dir labels Jul 8, 2020
@ry
Copy link
Member

ry commented Jul 8, 2020

Maybe this was introduced in 74c2605 ?

I think this shouldn't be a terrible difficult or involved fix. I will mark as "Good First Issue".

@ry ry added the good first issue Good for newcomers label Jul 8, 2020
@KrisChambers
Copy link
Contributor

I would like to take a stab at this one.

@jacobgc
Copy link
Contributor

jacobgc commented Jul 9, 2020

Just tested this with deno version 1.1.2 which is before my commit (74c2605) and can confirm that this issue is still present.

@utkzas
Copy link

utkzas commented Jul 14, 2020

I also want to contribute to this project (denojs). Can someone tell me how should I start?

@jsouto18
Copy link
Contributor

I've tested this on the latest release and I've managed to execute the code successfully running deno run --allow-net=:8080 server.ts or deno run --allow-net=0.0.0.0:8080 server.ts which seems to be the intended behaviour as the serve function binds to 0.0.0.0:8080.
@ry is this the intended behaviour?
The only other thing I found odd was trying to run serve(127.0.0.1:8080) and running deno run --allow-net=localhost:8080 server.ts fails because localhost is not resolved to the configured IP, for example in /etc/hosts.

@bartlomieju
Copy link
Member

Fixed in #6698

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants