Hi All,
we are trying the connect the “Kong API Gateway” which is running at “localhost:8000” for public, we are able host the API and able to get the data from upstream system.
But when we are trying the access the same API using “ws://localhost:8000” url then we are getting the
WebSocket connection to ‘ws://localhost:8000/getCustomerInfo’ failed: Error during WebSocket handshake: Unexpected response code: 404
Web-socket Code is:
<script> var ws = null; function connect() { if (ws !== null) return log('already connected'); ws = new WebSocket('ws://localhost:8000/getCustomerInfo'); ws.onopen = function () { log('connected'); }; ws.onerror = function (error) { log(error); }; ws.onmessage = function (e) { log('recv: ' + e.data); }; ws.onclose = function () { log('disconnected'); ws = null; }; return false; } function disconnect() { if (ws === null) return log('already disconnected'); ws.close(); return false; } function send() { if (ws === null) return log('please connect first'); var text = document.getElementById('text').value; document.getElementById('text').value = ""; log('send: ' + text); ws.send(text); return false; } function log(text) { var li = document.createElement('li'); li.appendChild(document.createTextNode(text)); document.getElementById('log').appendChild(li); return false; } </script>
and we are using the Docker container for running the KONG.
Kindly assist what we are doing wrong.