Freebox -- OCaml client for the Freebox router API#
Control a Freebox (French ISP router) via its REST API. Provides access to network hosts, port forwarding, WiFi, system info, downloads, and more.
Installation#
Install with opam:
$ opam install freebox
If opam cannot find the package, it may not yet be released in the public
opam-repository. Add the overlay repository, then install it:
$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install freebox
Usage#
let run () =
Eio_main.run @@ fun env ->
Eio.Switch.run @@ fun sw ->
let http = Requests.v ~sw env in
let clock = Eio.Stdenv.clock env in
let store = Freebox.Auth.memory_token_store () in
(* List connected devices. *)
(match Freebox.Hosts.all_hosts http ~clock store with
| Ok hosts ->
List.iter
(fun h -> Fmt.pr "%s (%s)@." h.Freebox.Hosts.hostname h.ip)
hosts
| Error (`Msg m) -> Fmt.epr "hosts: %s@." m);
(* Get system info. *)
match Freebox.System.info http ~clock store with
| Ok sys ->
Fmt.pr "Uptime: %s, board: %s@." sys.Freebox.System.uptime sys.board_name
| Error (`Msg m) -> Fmt.epr "system: %s@." m
Modules#
| Module | Description |
|---|---|
Auth |
App registration and session authentication |
Hosts |
Connected devices and network info |
Firewall |
Port forwarding and firewall rules |
Activity |
Network activity monitoring |
System |
System info, reboot, firmware |
Connection |
WAN connection status and bandwidth |
Wifi |
WiFi configuration and clients |
Switch |
Ethernet switch ports |
Calls |
Phone call log |
Downloads |
Download manager |
Parental |
Parental controls |
Fs |
File system browser |
Licence#
ISC