1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-10 00:28:23 +02:00
echo/website/content/recipes/websocket.md
Vishal Rana b6547dde66 recipe & website in the main repo
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-20 11:30:53 -07:00

787 B

+++ title = "WebSocket Recipe" description = "WebSocket recipe / example for Echo" [menu.side] name = "WebSocket" parent = "recipes" weight = 5 +++

WebSocket Recipe

Only supported in standard engine.

Using net WebSocket

Server

server.go

{{< embed "websocket/net/server.go" >}}

Using gorilla WebSocket

Server

server.go

{{< embed "websocket/gorilla/server.go" >}}

Client

index.html

{{< embed "websocket/public/index.html" >}}

Output

Client

Hello, Client!
Hello, Client!
Hello, Client!
Hello, Client!
Hello, Client!

Server

Hello, Server!
Hello, Server!
Hello, Server!
Hello, Server!
Hello, Server!

Maintainers

[Source Code]({{< source "websocket" >}})