bitfocus/companion-module-videolan-vlc

Target IP not accepting hostnames

Closed this issue · 4 comments

Hi,
Is it possible to add the possibilty to use the hostname instead of the IP address?

Kind regards

Koen

regex: Regex.IP,

Assuming VLC itself supports hostnames -- I can't think of a reason why it wouldn't -- this could be changed to Regex.HOSTNAME if one wanted to allow hostnames. But that would exclude IP addresses, which obviously isn't desirable.

It feels to me like the optimal solution would be for there to be a Regex.IP_OR_HOSTNAME, that could be used here. In advance of that, tho, this module (and all similar modules) could just inline a regular expression that combined the effect of both those.

The upstream change that would be needed to add a new Regex.IP_OR_HOSTNAME would need to appear here:

https://github.com/bitfocus/companion-module-base/blob/3fee9b0cf0c90b96d81d6fa947217038449d45d4/src/module-api/enums.ts#L23

istnv commented

Assuming VLC itself supports hostnames

VLC doesn't, it only responds to IP numbers. As long as the host has access to a DNS server of some sort, the connection will get the IP number from there.

Until there is an upstream addition, I've added a combined Regex. Should be in betas later today.

Oh sure, I was thinking if VLC syntactically applied its own Regex.IP to that input to it. :-) Unlikely to be sure, but not impossible.