GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - koding/websocketproxy: WebSocket reverse proxy handler for Go

BranchesTags
Open more actions menu

Latest commit

 

History

57 Commits
57 Commits

Folders and files

NameName
Last commit message
Last commit date
.travis.yml
.travis.yml
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
websocketproxy.go
websocketproxy.go
 
 
websocketproxy_test.go
websocketproxy_test.go
 
 

Repository files navigation

WebsocketProxy GoDoc Build Status

WebsocketProxy is an http.Handler interface build on top of gorilla/websocket that you can plug into your existing Go webserver to provide WebSocket reverse proxy.

Install

go get github.com/koding/websocketproxy

Example

Below is a simple server that proxies to the given backend URL

package main

import (
	"flag"
	"net/http"
	"net/url"

	"github.com/koding/websocketproxy"
)

var (
	flagBackend = flag.String("backend", "", "Backend URL for proxying")
)

func main() {
	u, err := url.Parse(*flagBackend)
	if err != nil {
		log.Fatalln(err)
	}

	err = http.ListenAndServe(":80", websocketproxy.NewProxy(u))
	if err != nil {
		log.Fatalln(err)
	}
}

Save it as proxy.go and run as:

go run proxy.go -backend ws://example.com:3000

Now all incoming WebSocket requests coming to this server will be proxied to ws://example.com:3000

About

WebSocket reverse proxy handler for Go

godoc.org/github.com/koding/websocketproxy

Resources

Readme
MIT license
Activity
Custom properties

Stars

437 stars

Watchers

17 watching

Forks

115 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.