In that case, you could just return

{header, {connection, erase}}

in the same list where you return streamcontent_from_pid, which removes any Connection header from the reply headers and also sets doclose in the process registry to false.

Just to clarify, I will make the streamcontent_from_pid return value enforce this side-effect for the connection header and setting, but if you want it to work immediately you could put it in your code right now and it would still work even after I change the code.

Something like this?
handle_out_reply({websocket, _OwnerPid, _SocketMode}=Reply,
                _LineNo,_YawsFile, _UT, _ARG) ->
    yaws:accumulate_header({connection, erase}),

First patch without this latest input can be found here:
There's a websockets_example.yaws file that should work out of the box.

wde, I have no clue how to test wss:// :/