From e3ad927ab38a3c800ddb4b1a0868dcd18e97099d Mon Sep 17 00:00:00 2001 From: GideonLeGrange Date: Mon, 30 Dec 2013 14:23:30 +0200 Subject: [PATCH] Added non-default port example --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ba91cb..09173aa 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,17 @@ con.login("admin","password"); // log in to router con.execute("/system/reboot"); // execute a command con.disconnect(); // disconnect from router ``` +If your router does not use the default API port, the port can be specified when connecting: + +```java +ApiConnection con = ApiConnection.connect("10.0.1.1", 1337); // connect to router on port 1337 +``` To open an encrypted (TLS) connection is as simple, assuming the default API-SSL port is used: ```java ApiConnection con = ApiConnection.connectTLS("10.0.1.1"); // connect to router con.login("admin","password"); // log in to router -con.disconnect(); // disconnect from router ``` Currently only anonymous TLS is supported, not certificates.