<p>I would like to start websocket connections (ws://whaterver)
in OpenShift but somehow they always ends with ERR_CONNECTION_ABORTED
immediately (new WebSocket('ws://whatever').</p>
<p>First I thought that the problem is in our application
but I created a minimal example and I got the same result.</p>
<p>First I created a pod and started this minimal Python websocket server.</p>
<pre><code>import asyncio
import websockets
async def hello(websocket, path):
    name = await websocket.recv()
    print(f&quot;&lt; {name}&quot;)
    greeting = f&quot;Hello {name}!&quot;
    await websocket.send(greeting)
    print(f&quot;&gt; {greeting}&quot;)

start_server = websockets.serve(hello, &quot;0.0.0.0&quot;, 8000)
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
</code></pre>
<p>Then I created a service (TCP 8000) and created a routing too and I got the same result.</p>
<p>I also tried to use different port or different targets (e.g.: /ws), without success.
This minimal script was able to respond to a simple http request, but for the websocket connection it can't.</p>
<p>Do you have any idea what could be the problem?
(by the documentation these connections should work as they are)
Should I try to play with some routing environment variables or are there any limitations which are not mentioned in the documentation?</p>

kfr
<p>Posting Károly Frendrich answer as community wiki:</p>
<blockquote>
<p>Finally we realized that the TLS termination is required to be set.</p>
</blockquote>
<p>It can be done using <a href="https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/routes.html#route-types" rel="nofollow noreferrer">Secured Routes</a></p>
