mirror of
https://github.com/huin/goupnp.git
synced 2025-09-26 20:31:10 +08:00
docs: update the guide to add LocalAddr() method. (resolves #58)
This commit is contained in:
4
GUIDE.md
4
GUIDE.md
@@ -45,6 +45,8 @@ type RouterClient interface {
|
||||
NewExternalIPAddress string,
|
||||
err error,
|
||||
)
|
||||
|
||||
LocalAddr() net.IP
|
||||
}
|
||||
|
||||
func PickRouterClient(ctx context.Context) (RouterClient, error) {
|
||||
@@ -116,7 +118,7 @@ func GetIPAndForwardPort(ctx context.Context) error {
|
||||
// port number.
|
||||
1234,
|
||||
// Internal address on the LAN we want to forward to.
|
||||
"192.168.1.6",
|
||||
client.LocalAddr().String(),
|
||||
// Enabled:
|
||||
true,
|
||||
// Informational description for the client requesting the port forwarding.
|
||||
|
Reference in New Issue
Block a user