Skip to content

Troubleshooting

Background

ArrigoLocal depends heavily on WebSockets for both getting updated values from controllers and when using ServerSideFunctions. WebSockets is an open standard that has been supported by web browsers since 2011. The WebSocket protocol is designed to work over HTTP ports 443 and 80 as well as to support HTTP proxies and intermediaries, making it compatible with HTTP.

WebSockets in ArrigoLocal

The ArrigoLocal API has two specific endpoints for creating new WebSocket connections:

  • /arrigo/api/graphql/ws (value updates from controllers etc.)
  • /arrigo/api/wamp (ServerSideFunction calls)

Verifying communication

Start by opening the DevTools in the browser. For Chrome you can presss F12, and for Microsoft Edge you press Ctrl+Shift+I.

Navigate to the Network tab and select the WS option. Clear the current logs before refreshing the page: Network tab, WS and clear logs

You should see a new websocket connection with the Time or State set to Pending: Time or State is Pending

Click on the connection to inspect the details: Viewing details

Select the Messages tab. Messages in green are sent from the browser to the server. Messages in white are sent from the server to the browser: Viewing Messages

Click on a message to view its contents.
Here we see an update from the server to the browser. It tells us that a specific variable has gotten a new value update (the new value is 0): Message details

Common errors

These are the two most common errors we get contacted about regarding WebSockets. The common symptom for these errors is that bound variables (in views) aren't shown but instead you see the "yellow box" pending state when the web runtime is waiting for the initial value updates. A description of these symptoms that we also hear a lot is: "It works on localhost or the intranet, but not when accessed from the outside (internet)".

Self-signed certificates

Read more about why you should not use self-signed certificates here

Browsers are very strict and do not accept self-signed certificates unless the user grants explicit permission. And even then, some functionality can fail silently (such as the creation of WebSockets).

Try switching over to using "regular" http (i.e. not https) to access the site from the outside. If everything works the self-signed certificate is to blame.

Buy a certificate from a trusted Certificate Authority if you need SSL/TLS.

Firewalls and reverse proxies

Some firewalls and reverse proxies do not allow WebSockets or need some configuration for this to work.

Firewalls

Since all vendors have their specific ways of enabling WebSockets we recommend that you simply search the internet for your model. Example: barracuda firewall enable websockets

Or perhaps your IT department can help you with the configuration?

Reverse proxies

For reverse proxies you sometimes need to configure it to pass the WebSocket connection upgrade (101 Switching Protocols). Search for your vendor and follow the examples/guides. Example: nginx websockets proxy

Note that some proxies require you to configure both the /arrigo/api/graphql/ws and /arrigo/api/wamp endpoints.

nginx example

If you use nginx as reverse proxy, the following configuration should work:

location /arrigo/api/graphql/ws {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_http_version 1.1;
  proxy_set_header Upgrade "websocket";
  proxy_set_header Connection "Upgrade";
  proxy_pass http://[the ip address of the Arrigo server]:80;
}

location /arrigo/api/wamp {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_http_version 1.1;
  proxy_set_header Upgrade "websocket";
  proxy_set_header Connection "Upgrade";
  proxy_pass http://[the ip address of the Arrigo server]:80;
}