go-fritzbox

module
v0.0.0-...-8c89a97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2020 License: MIT

README

go-fritzbox#

go-fritzbox is a Go client libary for accessing a FRITZ!Box (>=FRITZ!OS 5.50)

Documentation: GoDoc

Build Status: Build Status

Test Coverage: Coverage Status

go-fritzbox requires Go version 1.1 or greater.

Usage

import "github.com/philippfranke/go-fritzbox/fritzbox

Construct a new FRITZ!Box client, then use auth method in order to log in. For example, to access Fritz!Box as user "Peter":

client := fritzbox.NewClient(nil)
err := client.Auth("Peter", "Passw0rD!")

Access remote FRITZ!Box over SSL

The recommended way to access a FRITZ!Box over SSL is using a valid SSL certificate, but you can always skip validation. See http docs for complete instruction on using http.Client.

url, _ := url.Parse("https://example.com")
// !!! Not recommended !!!
tr := &http.Transport{
  TLSClientConfig: &tls.Config{
    InsecureSkipVerify: true,
  },
}
c := &http.Client{Transport: tr}

client := fritzbox.NewClient(cl)
client.BaseURL = url

// Login
err := client.Auth("Peter", "Passw0rD!")

License

This library is distributed under the MIT-style license found in the LICENSE file.

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL