title: R shiny: Can runApp() open shiny apps in browser at "http://localhost:port/" instead of "http://127.0.0.1:port/"?
body: <p>By default, shiny apps open "<a href="http://127.0.0.1:portXYZ/" rel="nofollow noreferrer">http://127.0.0.1:portXYZ/</a>" to run in a new tab of the default browser. Manually typing in "<a href="http://localhost:portXYZ/" rel="nofollow noreferrer">http://localhost:portXYZ/</a>" works equally well to get to the app once it is running, but that isn't the URL string that R pops up automatically. </p>
  
  <p>I've developed a shiny app (launched via <code>runApp()</code>) for users in a corporate environment where many users have Internet Explorer 11 set as their default browser. For some reason (group policy security settings?), the current IE11 setup fails to load "<a href="http://127.0.0.1:portXYZ" rel="nofollow noreferrer">http://127.0.0.1:portXYZ</a>" but works fine with "<a href="http://localhost:portXYZ" rel="nofollow noreferrer">http://localhost:portXYZ</a>". (Either way works fine in other Chrome or Firefox.)</p>
  
  <p>In lieu of asking everyone to use a workaround, is there a way to get shiny to open a "localhost" URL directly?</p>
  
  <p>For example, this R syntax executes fine (but doesn't fulfill my objectives):</p>
  
  <pre><code>&gt;library(shiny)
  &gt;runExample("01_hello", host = "127.0.0.1")
  </code></pre>
  
  <p>Whereas this R syntax fails with errors (but would fulfill my objectives if it worked):</p>
  
  <pre><code>&gt;library(shiny)
  &gt;runExample("01_hello", host = "localhost")
  
  Listening on http://localhost:5190
  Error in startServer(host, port, handlerManager$createHttpuvApp()) : 
    Failed to create server
  </code></pre>
  
  <p>And The IE11 error message for failing to find 127.0.0.1 is: </p>
  
  <pre><code>"Can't reach this page. This website could not be found. Error Code: INET_E_RESOURCE_NOT_FOUND"
  </code></pre>
  
  <p>If it helps, my R session info is:</p>
  
  <pre><code>R version 3.4.2 (2017-09-28)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  Running under: Windows &gt;= 8 x64 (build 9200)
  Matrix products: default
  
  locale:
  [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
  [5] LC_TIME=English_United States.1252    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] shiny_1.0.5
  
  loaded via a namespace (and not attached):
   [1] compiler_3.4.2  R6_2.2.2        htmltools_0.3.6 tools_3.4.2     pillar_1.2.1    tibble_1.4.2    Rcpp_0.12.16    jsonlite_1.5    digest_0.6.15   xtable_1.8-2   
  [11] httpuv_1.3.6.2  mime_0.5        rlang_0.2.0 
  </code></pre>
  
  <p>Any suggestions for how to get <code>runApp()</code>/<code>runExample()</code> to open a "localhost" shiny URL directly?</p>