# Does tapir zio-http support websockets

**URL:** <https://softwaremill.community/t/does-tapir-zio-http-support-websockets/267>\
**Category:** tapir\
**Created:** [August 22, 2023, 7:45pm UTC](https://softwaremill.community/t/does-tapir-zio-http-support-websockets/267 "2023-08-22T19:45:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ysedira](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/ysedira/32/183_2.png) [@ysedira](https://softwaremill.community/u/ysedira)\
**Post date:** [August 22, 2023, 7:45pm UTC](https://softwaremill.community/t/does-tapir-zio-http-support-websockets/267/1 "2023-08-22T19:45:26Z")

</div>

Hello folks,

I am trying to set up a zio-http server that expose a couple of websockets endpoint with tapir-zio-http-server, however ZioHttpInterpreter seems to be expecting to get a list of endpoint with ZioStreams only but using webSocketBody construct generate and endpoint with ZioStreams and WebSockets.

Question is there a way to support webSockets with ZioHttp?

```auto
object WebSocketApp extends zio.ZIOAppDefault {

  override def run: ZIO[Any with ZIOAppArgs with Scope, Any, Any] = {

    val pipe: stream.Stream[Throwable, WebSocketFrame] => stream.Stream[Throwable, WebSocketFrame] =
      (s: stream.Stream[Throwable, WebSocketFrame]) => s.map(v => WebSocketFrame.text(s"echo: $v"))

    val we: ZServerEndpoint[Nothing, ZioStreams] =
      endpoint
        .in("ws")
        .out(webSocketBodyRaw(ZioStreams))
        .zServerLogic(_ => ZIO.succeed(pipe))

    val interpreter = ZioHttpInterpreter()
    val http = interpreter.toHttp(we)

    Server.install(http.withDefaultErrorResponse)

  }

}

```

---

<div class="post-metadata">

**Author:** ![adamw](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/adamw/32/28_2.png) [@adamw](https://softwaremill.community/u/adamw)\
**Post date:** [August 23, 2023, 7:11am UTC](https://softwaremill.community/t/does-tapir-zio-http-support-websockets/267/2 "2023-08-23T07:11:19Z")

</div>

Websockets aren’t yet implemented in the ZIO Http interpreter. Please [vote on the issue](https://github.com/softwaremill/tapir/issues/1472), if you’d like to see this implemented, and/or create a PR on your own! 🙂

---

<div class="post-metadata">

**Author:** ![yabosedira](https://dub1.discourse-cdn.com/flex005/user_avatar/softwaremill.community/yabosedira/32/185_2.png) [@yabosedira](https://softwaremill.community/u/yabosedira)\
**Post date:** [September 1, 2023, 12:03am UTC](https://softwaremill.community/t/does-tapir-zio-http-support-websockets/267/3 "2023-09-01T00:03:37Z")

</div>

Hey @adamw ,

thank you for your response.

I have opened a draft [PR](https://github.com/softwaremill/tapir/pull/3147) with initial implementation for web socket support for zio-http, I would appreciate it if I can get an early feedback.
