From 43c6d4c83dd6d5f2e8997b57f12dbe6fd2960c86 Mon Sep 17 00:00:00 2001 From: lutovich Date: Mon, 19 Dec 2016 17:53:44 +0100 Subject: [PATCH] Prefer node channel over websocket channel when both available Fixes #154 --- src/v1/internal/connector.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v1/internal/connector.js b/src/v1/internal/connector.js index 72d0d28c4..7c844ad5d 100644 --- a/src/v1/internal/connector.js +++ b/src/v1/internal/connector.js @@ -26,11 +26,11 @@ import {Node, Relationship, UnboundRelationship, Path, PathSegment} from '../gra import {newError} from './../error'; let Channel; -if( WebSocketChannel.available ) { - Channel = WebSocketChannel.channel; +if( NodeChannel.available ) { + Channel = NodeChannel.channel; } -else if( NodeChannel.available ) { - Channel = NodeChannel.channel; +else if( WebSocketChannel.available ) { + Channel = WebSocketChannel.channel; } else { throw newError("Fatal: No compatible transport available. Need to run on a platform with the WebSocket API.");