How to debug rust web server in vs code - visual-studio-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.

Related

Getting VS code server to run on Sagemaker Studio

I am currently in the process of exploring the possible use of VS Code Server on Sagemaker Studio. Of course, if you sign up through Code Server preview, I was able to set and start it up. However, when I tried to serve it locally, I encountered a blank page after modifying the /default/proxy/XXX part of the url like how we access tensorboard.
Just wondering on whether are there any tinkerers out there that managed to get it working? (and yes, I understand that somebody managed to get it running https://coder.com/docs/code-server/latest/CONTRIBUTING. but wondering whether anybody managed to use the native installation to work properly? Any possible steps that i may be missing?
Check out the blog post here for hosting code-server on SageMaker Studio - https://aws.amazon.com/blogs/machine-learning/host-code-server-on-amazon-sagemaker/
And associated git repo here - https://github.com/aws-samples/amazon-sagemaker-codeserver

Unable to connect to localhost, bs-local, etc on Browserstack

I'm attempting to do some development on iOS for a model-viewer web component through browserstack (using iOS 13 Chrome) and it seems unable to connect to localhost, whether I use bs-local (as suggested via browserstack), my IP, or anything else.
I went through their troubleshooting guides with no success, and their own "Debug Connectivity" test in localhost:45454 seems to return a 200 OK response for my page, but live.browserstack.com still seems unable to connect (it returns "Unable to display the page").
I'm attempting to run it using iOS 13 on Chrome.
I've set up the proxy details, enabled 'Force Local', and installed the Browserstack Local app and have verified that it is connected correctly. The URL formats I have tried are:
http://localhost:8000/dev/index.html
http://bs-local.com:8000/dev/index.html
http://bs-local:8000/dev/index.html
http://<my-ip>:8000/dev/index.html
I am writing my code in VS Code and am using node.js/npm and npm run serve using Ubuntu (WSL) in the terminal to start the web dev server, which starts on its own correctly. Opening the page on my own machine seems to work fine, it is solely unable to connect through browserstack live.
Is there a step that I'm missing? What should I troubleshoot next? I'm a junior developer, so please explain in detail.

VS Code : Sign In Error :You appear to be offline. Please check your network connection

In VS Code when i try to run the below command for sign in
I get below error message and it is not able to login
I had the same issue due to working behind a company proxy. I could solve it by writing the http proxy in the settings (instead of leaving it empty and inheriting from environment variables).
I had the same issue - the problem was that my VS code was still remotely connected to my office server via SSH. I killed that connection ("close remote connection") and it allowed me to sign in.
Same exact issue for me, caused (most likely) by my company's proxy blocking the sign-in request. What fixed it was:
closing Visual Studio Code (previously opened through code . in WSL in my case);
opening Visual Studio Code again directly in Windows;
Login to Azure (then finally the browser opened with the login page and I could get in)
Of course your log-in will be saved also when you close VSCode in windows and reopen in WSL.

Setting Corporate network proxy in 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!

Nodered IBM-examples are not working on my PC

I tried 2 example programs from the IBM website.
timestamp example
I cannot see anything in the debug tab. Debug node is of course activated and its output is set to debug tab and console.
Chrome developer tools gives some more information:
Warning: SVG's SMIL animations (, , etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.
It also detects that something has happended (Preview "OK", Response "OK").
I also tried Chat example
But even when I try to execute the "Run the app" button the window never displays "connection established" or any chat message. Chrome developer tools throws error:
Uncaught InvalidStateError: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
I did not install anything related to Java, JS, JSON, Node.js on my pc as I asume that everything runs inside Bluemix.
The underlying issue is a failure to establish a websocket connection with the node-red instance running in Bluemix. This is a known issue when accessing from certain networks that is usually resolved by accessing the application using https rather than http.