GOWS is GoLang web-socket module Provides you with ease of handling web socket connections with a few lines

Related tags

Network gows
Overview

GOWS

GOWS is GoLang web-socket module Provides you with ease of handling web socket connections with a few lines, it supports multi-connection on one channel, Ping/Pong handler, saves multi concurrency writes on hub and connections.


Installation :

go get -u github.com/es-code/gows

Usage :


var ws *gows.Hub

func main()  {
ws = gows.Init()

//endpoint to open ws connection and read messages , write message to connection
http.HandleFunc("/message/listen",messageSocket)
//start web server
http.ListenAndServe(":9000",nil)

}
func messageSocket(res http.ResponseWriter, req *http.Request)  {

channel:=req.FormValue("channel")

//open connection for current request
conn,err:=ws.Open(channel,res,req)

if err!=nil{
fmt.Println("ws error open conn")
}
//start listen for messages
err=ws.Listen(conn,func(messageType int, message []byte) {
//your code here to handle every message
//example : re-write message on channel
ws.WriteOnChannel(channel,message)
})

if err!=nil{
fmt.Println("gows connection ended")
}
return

}
You might also like...
A little library for turning TCP connections into go channels.

netutils By Tim Henderson ([email protected]) This is a little library that was part of a larger project that I decided to pull out and make public.

An incredibly fast proxy checker & IP rotator with ease.
An incredibly fast proxy checker & IP rotator with ease.

An incredibly fast proxy checker & IP rotator with ease.

wire protocol for multiplexing connections or streams into a single connection, based on a subset of the SSH Connection Protocol

qmux qmux is a wire protocol for multiplexing connections or streams into a single connection. It is based on the SSH Connection Protocol, which is th

Simple, secure and modern Go HTTP server to serve static sites, single-page applications or a file with ease

srv srv is a simple, secure and modern HTTP server, written in Go, to serve static sites, single-page applications or a file with ease. You can use it

UDP Transport: compress, encrypt and send any data reliably over unreliable UDP connections

udpt UDP Transport Compresses, encrypts and transfers data between a sender and receiver using UDP protocol. Features and Design Aims: Avoid the overh

Designed to support DNS brute-forcing with a minimal number of network connections

Fast Use of DNS Resolvers Designed to support DNS brute-forcing with a minimal number of network connections. Installation go get -v -u github.com/caf

🧮 SOCKS5/4/4a 🌾 validating proxy pool for 🤽 LOLXDsoRANDum connections 🎋
🧮 SOCKS5/4/4a 🌾 validating proxy pool for 🤽 LOLXDsoRANDum connections 🎋

Prox5 SOCKS5/4/4a validating proxy pool This package is for managing and accessing thousands upon thousands of arbitrary SOCKS proxies. It also has a

Fail2Connect - Ban connections that fail to connect

Fail2Connect - Ban connections that fail to connect Fail2Connect is a program written in Golang. It reads log files like /var/log/openvpn.log or /var/

go HTTP client that makes it plain simple to configure TLS, basic auth, retries on specific errors, keep-alive connections, logging, timeouts etc.

goat Goat, is an HTTP client built on top of a standard Go http package, that is extremely easy to configure; no googling required. The idea is simila

Releases(v1.0.0)
  • v1.0.0(Nov 20, 2021)

    Initial Release for GOWS Support :

    • Multi-connection on one channel.
    • Ping/Pong handler.
    • Saves multi concurrency writes on hub and connections.
    Source code(tar.gz)
    Source code(zip)
Owner
null
Glue - Robust Go and Javascript Socket Library (Alternative to Socket.io)

Glue - Robust Go and Javascript Socket Library Glue is a real-time bidirectional socket library. It is a clean, robust and efficient alternative to so

DesertBit 408 Nov 25, 2022
Simple Relay between a Unix socket and a TCP socket, and vice versa.

Simple TCP <-> Unix Relay simpletcpunixrelay is a program which exposes a TCP endpoint as a Unix socket and vice versa. Usecase Let's say you are runn

Antoine Catton 1 Nov 23, 2022
Plugs module to see different types of plug types needed in different countries, and a comparison tool between two countries plug socket types.

plugs Importing the module: go get github.com/matthewboyd/plugs "github.com/matthewboyd/plugs" How to use the module: There are two functions wi

Matthew Boyd 2 Dec 28, 2021
rconn is a multiplatform program for creating generic reverse connections. Lets you consume services that are behind firewall or NAT without opening ports or port-forwarding.

rconn (r[everse] conn[ection]) is a multiplatform program for creating reverse connections. It lets you consume services that are behind NAT and/or fi

Hikmat Jafarli 306 Nov 22, 2022
Multiplexer over TCP. Useful if target server only allows you to create limited tcp connections concurrently.

tcp-multiplexer Use it in front of target server and let your client programs connect it, if target server only allows you to create limited tcp conne

许嘉华 3 May 27, 2021
Package socket provides a low-level network connection type which integrates with Go's runtime network poller to provide asynchronous I/O and deadline support. MIT Licensed.

socket Package socket provides a low-level network connection type which integrates with Go's runtime network poller to provide asynchronous I/O and d

Matt Layher 48 Nov 15, 2022
A golang universal connections pool.

gopool A golang universal connection pool. Features: Using arrays instead of channels to improve performance Automatically detect live server nodes an

believe 5 Jul 15, 2022
Remake of the original sqlifinder but in GOlang, and allows for listed targets, domain crawling, and tor connections

_______ _____ _____ _______ _____ __ _ ______ _______ ______ |______ | __| | | |______ | | \ | | \ |______ |_____/

RE43P3R 1 Aug 17, 2022
Slash command for Slack/Mattermost to post punch lines

Slash command pro milujipraci.cz This project is by its nature dedicated to czech or slovak speaking users, so I suggest you to either learn Czech or

Martin Chodur 5 Jan 18, 2022
Web socket in go :book:

websockets-in-go curl -i -G -d "id=UC29ju8bIPH5as8OGnQzwJyA&part=statistics&key=AIzaSyCuhMEgZHU6Epb9rjzKtRRGJY8bLEZjTA8" https://www.googleapis.com/yo

Sudip Shrestha 2 Sep 6, 2021