Advertisement
Guest User

Untitled

a guest
Nov 24th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. read_Password <- function(prompt) {
  2. if (requireNamespace("rstudioapi")) {
  3. pwd <- rstudioapi::askForPassword(prompt)
  4. } else if (exists(".rs.askForPassword")) {
  5. pwd <- .rs.askForPassword(prompt)
  6. } else {
  7. pwd <- readline(prompt)
  8. }
  9. return (pwd)
  10. }
  11.  
  12.  
  13. set_config_proxy <- function(url, port, username, password = NULL, verbose = F){
  14. if (is.null(password)) {
  15. password <- read_Password("Enter a password for passing your proxy:")
  16. } else {
  17. if (verbose) {
  18. message("Using provided password. Your password will seen in clear in your history command.")
  19. }
  20. }
  21.  
  22. httr::set_config(
  23. httr::use_proxy(url = url,
  24. port = port,
  25. username = username,
  26. password = password))
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement