Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Vs Code debugger does not use https protocol when starting dev server #1440

Open
Tusshu opened this issue Jul 5, 2024 · 6 comments
Open
Labels
feature A new feature or request p3 Issues that we currently consider unimportant product: vscode extension Issues related to the Dart Frog VSCode extension waiting for response Waiting for follow up

Comments

@Tusshu
Copy link

Tusshu commented Jul 5, 2024

Description

  1. Created security context for method serve(handler, ip, port, securityContext: securityContext) as listed in the documentation.
  2. Ran the dev server using Dart Frog: Start and Debug Development server option in the Command Pallet of VS code.
  3. Specified port as 8443 when asked "which port number server should start on"
  4. Specified 8181 when asked "Which port number the Dart VM server should listen"
  5. Browser opens up and shows http://localhost:8443/ in the URL window and following message:
    6 This site can’t be reached. The webpage at https://localhost:8443/ might be temporarily down or it may have moved permanently to a new web address. ERR_FAILED

Expected Behavior

  1. Response returned in index.dart page is expected to be displayed.
  2. https protocol to be shown in URL when security context used in the serve() call in run() method.
@Tusshu Tusshu added the bug Something isn't working as expected label Jul 5, 2024
@alestiago
Copy link
Contributor

alestiago commented Jul 9, 2024

@Tusshu thanks for opening an issue!

I haven't tried to reproduce, but as far as I believe what you're stating is a valid request. The browser should open with https when a security context is specified. I believe there is no logic in place in the VS Code extension to cater for such use-case right now.

As far as I am concerned, the Dart Frog Daemon doesn't report the information on whether or not the Dart Frog project is using a Security Context or not. Hence, to land this change we would have to:

  • Update the Daemon to report if a Security Context is being specified
  • Update the VS Code extension to check with the Daemon if the current Dart Frog project is using a Security Context and open with HTTPS accordingly

I'm not sure if the team has bandwidth to prioritise this work right now (cc: @tomarra ), however, if you're interested in contributing to this effort we can definitely help you review and land the Pull Request.

@Tusshu
Copy link
Author

Tusshu commented Jul 10, 2024 via email

@alestiago
Copy link
Contributor

@Tusshu no worries I understand. You can still use Dart Frog and launch using Dart Frog CLI instead of the extension, or simply update the URL to include the "s" manually.

If at any point you would like to contribute let me know and I can get you assigned. For the time being you can track how the team prioritises this issue by watching it within the Full Board.

@Tusshu
Copy link
Author

Tusshu commented Aug 15, 2024

That is good news!!!
You mentioned "simply update the URL to include the "s" manually"
I am not sure how to do that. In VSCode, I click on the Run | Debug above the response function to start the server. It asks for two ports, 8080 and 8081 before starting the server. I can specify 8443 instead of 8080. But there is no access to URL where I can specify https.
How or where do I get access to the URL?
Thanks!

@Tusshu
Copy link
Author

Tusshu commented Aug 23, 2024 via email

@alestiago
Copy link
Contributor

You first need to set the security context as specified in the documentation.

Once you have that going, you can attach a debugger by using the "Debug" above the response function, such will open a web browser, but using HTTP rather than HTTPS. If you modify the browser URL to include an "s", you'll see how the breakpoints are hit when in debug mode. Another option is to use tools like Postman, curl, and use the endpoint you wish.

I hope this makes sense 🙌 , let me know if it helps.

@alestiago alestiago added waiting for response Waiting for follow up feature A new feature or request product: vscode extension Issues related to the Dart Frog VSCode extension and removed bug Something isn't working as expected labels Aug 26, 2024
@tomarra tomarra added the p3 Issues that we currently consider unimportant label Oct 22, 2024
@tomarra tomarra moved this from Needs Triage to Backlog in VGV Open Source 🦄 🧙🌟 Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or request p3 Issues that we currently consider unimportant product: vscode extension Issues related to the Dart Frog VSCode extension waiting for response Waiting for follow up
Projects
Status: Backlog
Development

No branches or pull requests

3 participants