Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jouniso committed Dec 11, 2018
2 parents e2ba791 + e287c9f commit 40a9f10
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion pages/meriliikenne-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Both metadata and content is updated in real time.
Vessel locations can be tracked from following Web Socket APIs. Protocol is MQTT over WebSockets. This allows
you to subscibe only those topics you are interested in.

Production address is wss://meri.digitraffic.fi:61619/mqtt

When using Paho JS-client the address is plain meri.digitraffic.fi and port 61619, see example below.

Address for test is meri-test.digitraffic.fi

#### Topics

Topics are constructed like this:
Expand Down Expand Up @@ -143,7 +149,7 @@ Message formats:
function connect() {
console.log('trying to connect marine mqtt...');
client = new Paho.MQTT.Client("meri-aws-mqtt.digitraffic.fi", 61619, 'testclient_' + Date.now());
client = new Paho.MQTT.Client("meri-test.digitraffic.fi", 61619, 'testclient_' + Date.now());
client.onConnectionLost = function (response) {
console.info(Date.now() + ' Connection lost:' + response.errorMessage);
Expand Down
10 changes: 8 additions & 2 deletions pages/meriliikenne.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ Sekä metadataa että dataa päivitetään reaaliaikaisesti.
Laivojen sijainteja voi kuunnella WebSocket-rajapinnoista. Käytetty protokolla on MQTT over WebSockets, joka mahdollistaa
ainoastaan haluttujen tietojen vastaanoton topicien avulla.

Tuotannon osoite on wss://meri.digitraffic.fi:61619/mqtt

Pahon JS-clientia käyttäessä osoite on pelkkä meri.digitraffic.fi ja portti 61619, esimerkki alempana.

Testin osoite vastaavasti meri-test.digitraffic.fi

#### Topicit

Topicit ovat seuraavanlaista muotoa:
Expand Down Expand Up @@ -126,7 +132,7 @@ Viestit ovat muotoa:
}
```

#### Yksinkertainen JavaScript WebSocket -clientti
#### Yksinkertainen JavaScript WebSocket -client

```
<html>
Expand All @@ -143,7 +149,7 @@ Viestit ovat muotoa:
function connect() {
console.log('trying to connect marine mqtt...');
client = new Paho.MQTT.Client("meri-aws-mqtt.digitraffic.fi", 61619, 'testclient_' + Date.now());
client = new Paho.MQTT.Client("meri-test.digitraffic.fi", 61619, 'testclient_' + Date.now());
client.onConnectionLost = function (response) {
console.info(Date.now() + ' Connection lost:' + response.errorMessage);
Expand Down

0 comments on commit 40a9f10

Please sign in to comment.