Skip to content

Tomy2e/livebox-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Livebox API client

This Go library makes it easy to communicate with Livebox's API. This API is usually available at http://192.168.1.1/ws. Authentication is handled by the library, set the admin password and start sending requests.

It was tested with a Livebox 5. Other Livebox models might not be supported.

Usage

Get the library by running the following command:

go get -u github.com/Tomy2e/livebox-api-client

Import the library in your source file:

import "github.com/Tomy2e/livebox-api-client"
import "github.com/Tomy2e/livebox-api-client/api/request"

Create a new client:

// Client with default HTTP client
client, _ := livebox.NewClient("<admin-password>")

// Client with custom HTTP client
client, _ := livebox.NewClient("<admin-password>", livebox.WithHTTPClient(&http.Client{}))

Send requests using the client:

var r json.RawMessage

_ = client.Request(
    context.Background(),
    request.New("TopologyDiagnostics", "buildTopology", map[string]interface{}{"SendXmlFile": false}),
    &r,
)

fmt.Println(string(r))

Releases

No releases published

Packages

No packages published

Languages