-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Echo response that implements http.Hijack #68
Comments
Can you share the code? |
I have created a minimal example that reproduces the problem: https://gist.github.com/mschewe/47b08668e6b81f3d4b4f |
Please verify - #70 PS: I have a plan to add web socket to the API in future. |
As far as I can see it does now work perfectly. Thank you very much! |
@mschewe FYI, I have added support for WebSocket in the latest version, here is a small example: package main
import (
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
"io"
)
func main() {
e := echo.New()
e.Use(middleware.Logger())
e.WebSocket("/ws/:token", func(c *echo.Context) error {
io.Copy(c.Socket(), c.Socket())
return nil
})
e.Run(":1323")
} You can also access path parameters from the context. |
Great, this make Echo even more useful! |
I could just copy that issue: go-martini/martini#45
It's almost the same problem. I am new to go and working on my first small project. I am now almost done and wanted to add websockets.
But I ran into this error
websocket: response does not implement http.Hijacker
.I guess I could just rewrite some parts and use Martini or some other framework, but I really started to like Echo.
What do you think? Would it be possible to implement http.Hijack or would this be against the concept of Echo?
As in the Martini issue I would like to say: "please excuse me if this is just nonesense".
The text was updated successfully, but these errors were encountered: