koron / go-ssdp

SSDP library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

option to using the system assigned multicast interface

koron opened this issue · comments

instead of interface lists

based on:

Is it enough to make the multicast listener replaceable?

Is it enough to make the multicast listener replaceable?

This is rejected as result of prototyping.
It's more complicated than it needs to be

https://pkg.go.dev/golang.org/x/net@v0.17.0/ipv4#PacketConn.JoinGroup

JoinGroup uses the system assigned multicast interface when ifi is nil, although this is not recommended because the assignment depends on platforms and sometimes it might require routing configuration.

It seems that the default interface is not available on Windows.
So we can't provide any generic ways to test this feature.

func OnlySystemInterface() Option can be used for this purpose.