It looks like you have a mistake in the Javascript part. The constructor for the Websocket needs two parameters, the first one is the URL and the second one is the protocol name:
let socket = new WebSocket("ws://172.16.20.202:8001","example-protocol");