Setting Corporate network proxy in Visual Studio Code? - visual-studio-code

I'm trying to use the Visual Studio Code IDE for Salesforce development. The IDE works fine in my personal network, where I can retrieve and upload the metadata file without any issue. When I connect to my office network I'm not able to do the same.The Salesforce CLI shows the following error while retrieving the metadata -
"error: connect etimedout 85.224.145.196:443"
Later I got to know that I will have to set up the network proxy in VS Code. I have gone through the following links and tried to add the proxy to the
VS code. Unfortunately, nothing worked for me -
Getting connect ETIMEDOUT when trying to install a VSCODE extension
http://www.niranjankala.in/post/How-to-setup-Proxy-settings-in-Visual-Studio-Code
I used to set the proxy in eclipse in this way-
Preference >> Network connection >> Proxy entries -
Schema: "HTTP" ,Host:Proxy URL of the company,Port:8080,Auth:"No" AND Proxy Bypass - Host:127.0.0.1, Provider:Manual
If somebody faced this before request you to share the way to resolve this issue. Thanks in advance!

Related

How to debug rust web server in vs code

I am building a web server using tide framework and I want to debug api function when server receive the request. However,when I click debug button on vs code, and using the curl command from terminal to send request to server, the terminal said "Failed to connect to port 3000,Connection refused". Does anyone know how to debug the rust web server on vscode?
I also had the same issue when I tried the code on this documentation page https://docs.rs/tide/latest/tide/. I'm going to assume that's what you're trying to debug?
I went to the github repository and there is a readme with a similar, but different example https://github.com/http-rs/tide. It works for me, and I could debug without any further issue using the rust-analyzer and CodeLLDB extensions.
Note: I had to restart my computer. After the first example failed I thought I'd try the curl command with a Node Express server to make sure there wasn't something blocking the request. After restarting this went away.

VS Code Remote Development Errors

I am connected to my company's VPN on my Windows 10 desktop and uses VS Code for my development. I wanted to use VS Code Remote Development so that I can connect to my remote company development server and autosave my files directly on the server. I have installed VS Code Remote Development package and this is my SSH config.
Host my.company.server
HostName 10.XXX.XXX.XX6
User root
IdentityFile C:\Users\My_User\Documents\Company\company_key.pem
However, when connect VS Code to the remote server, VS Code shows that I am connected but I am getting the errors below and cannot view the remote directory.
Unable to write to Folder Settings because no resource is provided.
Could not fetch remote environment.
Failed to connect to the remote extension host server
(Error: Websocket close with status code 1006)
I tried connecting to the remote server using WinSCP and that works fine. I also used PowerShell to login using the below command and that works fine too.
ssh -i C:\Users\My_User\Documents\Company\company_key.pem root#10.XXX.XXX.XX6
What am I doing wrong here? Any VS Code gurus can assist me with this issue? Thanks.
VSCode was attempting to download and install several components on that remote machine, which probably was blocked by the machine administrators in your company (as downloading from an external resource is commonly seen as a security risk on an internal machine).
You should carefully review the information security policies of the company before making any violation. And then discuss with your manager to see if VSCode Remote should be used or not.

How to package VS Code Extension behind proxy

I have created a VS Code extension that I want to distribute within my organization. My system runs behind a corporate proxy threfore when I try to create a publisher using the command vsce create-publisher (publisher name) I get following error:
ERROR tunneling socket could not be established, statusCode=407
It does not accept --proxy-server option that VS Code supports while installing extensions.
proxies are not supported by VSCE for now. It can published outside corporate networks only. This issue is open for last three years on github.
Please find this issue link.
https://github.com/Microsoft/vscode-vsce/issues/157

Eclipse unable to connect to internet when using a VPN

Eclipse is unable to connect to the internet when I am using a VPN.
The VPN I am using is: https://www.privateinternetaccess.com/
I have no issues when I try browsing the web using the VPN.
If I try to do something like access the Eclipse Marketplace I get an error saying connection fails and it suggests I should check my internet connection and retry.
I have tried restarting eclipse many times. I have tried changing my network connection preferences in eclipse (Direct, Manual, Native).
I don't really understand why connecting to a VPN should have any effect on eclipse.
Maybe, you have not set proxy (and login credentials) in the eclipse.

Cannot connect to SonarQube from Eclipse

I'm trying to connect my Eclipse IDE to my company's sonar server instance, but I can't figure out why it doesn't work.
When I access the server (https://mycompany.com/sonar, for example purposes) through the browser, it works perfectly. In Eclipse, I added the url to the servers section of SonarQube and the same credentials I used in the browser. When I hit Test Connection, I get the error message:
Unable to connect: Query: https://mycompany.com/sonar//api/authentication/validate
I'm using the native option in Eclipse's network settings, since I'm not behind any proxy. The company SonarQube server version is 4.5.5.
Am I doing something wrong? Does anyone know how to fix this?
Edit: the certificate is also added to JRE
I suspect the /api/aut is due to some UI truncation, just expand the 'Add SonarQube Server' window to verify that.
You are trying to connect to an HTTPS URL, is the server certificate trusted by Java ? Use keytool to do that, as explained in this post.
Check the sonar link you have configured in eclipse - https://mycompany.com/sonar**//**api/authentication/validate
You need to give the url https://mycompany.com/sonar and not https://mycompany.com/sonar/