microsoft / microsoft/vscode-livepreview

Live Preview "Host IP" setting does not support IPv6 addresses

Open
#179 9 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
TypeScript
Stars
596
Forks
119
Avg merge
1d 4m
Merged PRs (30d)
5

Description

Background

Support for specifying custom IP addresses was added by @andreamah as part of https://github.com/microsoft/vscode-livepreview/pull/117

The specific commit that adds this feature is 145f83606455f0b53f175f05142aa3a2d6632ea2 which has the following code snippet

https://github.com/microsoft/vscode-livepreview/blob/145f83606455f0b53f175f05142aa3a2d6632ea2/src/infoManagers/connectionManager.ts#L143-L149

Proposal

I propose that this code is changed so that it uses the NodeJS standard library's net.isIP which can properly validate IP addresses, and handle both IPv4 as well as IPv6

Next Steps

I think this would be a fairly simple fix, which I'm happy to code this up myself and submit a pull-request with the corresponding changes. Are there any other places I'd need to change, aside from connectionManager.ts? Is using a NodeJS library possible in the context of this extension? Or would I have to use an API from the front-end JavaScript side of things?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.