0

I referred to this question but I have a different question

Environment:

  1. The Jupyter Notebook is on AWS EMR.
  2. To access notebook from the browser using a SOCKS5 proxy. To do so, I have to connect to the VPN to work, SSH using PuTTY using .ppk file and Tunnel (Dynamic Port Forwarding).
  3. To automate the step above, I am using PLink(Homepage | Docs | Download) : c:\stuff\plink.exe --ssh -i c:\stuff\file.ppk -D XXXX user-name@<some_IP_address
  4. I can successfully enable proxy by using msedge.exe --proxy-server="socks5://<address>" or chrome.exe --proxy-server="socks5://<address>"
  5. VS Code Version:
C:\Users\ablaze>code --version
1.55.2
3c4e3df9e89829dce27b7b5c24508306b151f30d
x64

Objective:

  • How can I access the remote Jupyter Notebook hosted on AWS EMR behind a proxy from Visual Studio Code?

I tried and failed:

  • Given Visual Studio Code is built on top of Electron and benefits from all the networking stack capabilities of Chromium.

  • I used Plink like above to SSH and then executed the following command on my windows command prompt: C:\Users\ablaze>code --proxy-server="socks5://<address>" --verbose

Error message:

[17668:0505/104410.116:WARNING:dns_config_service_win.cc(692)] Failed to read DnsConfig.
[main 2021-05-05T14:44:10.224Z] Starting VS Code
[main 2021-05-05T14:44:10.224Z] from: c:\Users\ablaze\AppData\Local\Programs\Microsoft VS Code\resources\app
[main 2021-05-05T14:44:10.224Z] args: {
 _: [],

 ...

 'no-proxy-server': false,
 'proxy-server': 'socks5://localhost:8088',

  ...

  logsPath: 'C:\\Users\\ablaze\\AppData\\Roaming\\Code\\logs\\20210505T104410'
}

...

[main 2021-05-05T14:44:10.258Z] windowsManager#open pathsToOpen [
  {
    backupPath: 'C:\\Users\\ablaze\\AppData\\Roaming\\Code\\Backups\\1620224957079',
    remoteAuthority: undefined
  }
]

To double check I also opened the log file C:\Users\ablaze\AppData\Roaming\Code\logs\20210505T104410\main.log

... 

[2021-05-05 10:44:40.345] [main] [trace] update#checkForUpdates, state =  idle
[2021-05-05 10:44:40.345] [main] [info] update#setState checking for updates
[2021-05-05 10:44:40.345] [main] [trace] RequestService#request https://update.code.visualstudio.com/api/update/win32-x64-user/stable/3c4e3df9e89829dce27b7b5c24508306b151f30d
[2021-05-05 10:44:40.346] [main] [trace] resolveShellEnv(): skipped (Windows)
[2021-05-05 10:44:44.354] [main] [error] Error: net::ERR_PROXY_CONNECTION_FAILED
    at SimpleURLLoaderWrapper.<anonymous> (electron/js2c/browser_init.js:109:6508)
    at SimpleURLLoaderWrapper.emit (events.js:315:20)
[2021-05-05 10:44:44.354] [main] [info] update#setState idle
ablaze
  • 722
  • 7
  • 30
  • Not sure if I found anything here: https://github.com/search?q=org%3Amicrosoft+vscode+socks5&type=issues – ablaze May 05 '21 at 15:02
  • Are you trying to open an .ipynb file located on a remote host, or trying to connect to a running Jupyter server while running VS Code locally? If you're trying to do the former, the VS Code Remote-SSH extension may be what you need: https://code.visualstudio.com/blogs/2019/10/03/remote-ssh-tips-and-tricks#_proxycommand. – joyceerhl May 08 '21 at 04:56
  • @joyceerhl the latter. Not sure if the former would help. Trying open a Jupyter notebook from AWS EMR, at the end of the day. – ablaze May 09 '21 at 18:08
  • This is the Jupyter extension's remote server support right now: https://code.visualstudio.com/docs/python/jupyter-support#_connect-to-a-remote-jupyter-server If you've followed those directions and still can't connect, please file an enhancement request on https://github.com/microsoft/vscode-jupyter/issues. – joyceerhl May 09 '21 at 19:35

0 Answers0