Skip to content

Commit

Permalink
fix #55: update the list of ports considered unsafe by Chrome (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
RLesur authored Aug 11, 2021
1 parent 162215d commit 904832e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# CHANGES IN servr VERSION 0.23

- Updated the list of ports considered unsafe by Chrome (thanks, @RLesur, #56).

# CHANGES IN servr VERSION 0.22

Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ serve_example = function(name, FUN, ..., run = interactive()) {
#' @return A port number, or an error if no ports are available.
random_port = function(port = 4321L, host = getOption('servr.host', '127.0.0.1'), n = 20) {
# exclude ports considered unsafe by Chrome http://superuser.com/a/188070
ports = sample(setdiff(3000:8000, c(3659, 4045, 6000, 6665:6669)), n)
ports = sample(setdiff(3000:8000, c(3659, 4045, 5060, 5061, 6000, 6566, 6665:6669, 6697)), n)
ports = c(port, ports)
port = NULL
# when a port has been used on 0.0.0.0, port_available() still returns TRUE
Expand Down

0 comments on commit 904832e

Please sign in to comment.