## nim-websock ## Copyright (c) 2021-2023 Status Research & Development GmbH ## Licensed under either of ## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) ## * MIT license ([LICENSE-MIT](LICENSE-MIT)) ## at your option. ## This file may not be copied, modified, or distributed except according to ## those terms. {.push raises: [].} import std/[strutils, random] import pkg/[ chronos, chronos/streams/tlsstream, httputils, chronicles] import ../websock/websock import ./keys {.push gcsafe, raises: [].} const WSPath* = when defined secure: "/wss" else: "/ws" proc rndStr*(size: int): string {.gcsafe, raises: [].} = for _ in 0..