Skip to content

MordFustang21/websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supernova Websocket

GoDoc Go Report Card Build Status

Add websocket support for supernova/fasthttp

Example

package main

import (
	"log"
	"github.com/MordFustang21/supernova"
)

func main() {
	s := supernova.Super()

	// Websocket example
	s.All("/ws", func(req *supernova.Request) {
        err := upgrader.Upgrade(req, func(conn *supernova.Conn) {
            conn.WriteMessage(supernova.TextMessage, []byte("Web socket success"))
        })

        if err != nil {
            println("Error upgrading connection")
        }
    })

	err := s.Serve(":8080")

	if err != nil {
		log.Fatal(err)
	}
}

About

Adds websocket support to supernova/fasthttp

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages