Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deno permissions (--allow-net)

Tags:

deno

The one day old docs is not clear enough for me to know..

How to give global permission to all websites (for debugging stuff) in my deno project like..

deno run --allow-net=* deno.ts

or something like that

like image 510
Youssef Siam Avatar asked May 14 '20 20:05

Youssef Siam


2 Answers

Just use --allow-net without anything else.

Unless you specify something, you will give permission to all network calls.

# All requests allowed
deno run --allow-net deno.ts

# only calls to stackoverflow.com
deno run --allow-net=stackoverflow.com deno.ts

The same goes for all the other permissions.

like image 158
Marcos Casagrande Avatar answered Sep 28 '22 12:09

Marcos Casagrande


It is possible to allow urls from either one domain or multiple domains.

# For one domain permission: 
  deno run --allow-net=xyz.com

# For multiple domains, give comma separated values: 
  deno run --allow-net=xyz.com,abc.com

adding xyz.com/api/v1/user/ and protocols like http, are not needed.

like image 32
Gowtham MG Avatar answered Sep 28 '22 10:09

Gowtham MG