forked from mirror/websocket
fix repos
This commit is contained in:
parent
76ecc29eff
commit
9204c968d1
|
@ -17,7 +17,7 @@ jobs:
|
||||||
default: ""
|
default: ""
|
||||||
docker:
|
docker:
|
||||||
- image: "cimg/go:<< parameters.version >>"
|
- image: "cimg/go:<< parameters.version >>"
|
||||||
working_directory: /home/circleci/project/go/src/github.com/gorilla/websocket
|
working_directory: /home/circleci/project/go/src/git.internal/re/websocket
|
||||||
environment:
|
environment:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
GOPROXY: "<< parameters.goproxy >>"
|
GOPROXY: "<< parameters.goproxy >>"
|
||||||
|
|
16
README.md
16
README.md
|
@ -1,6 +1,6 @@
|
||||||
# Gorilla WebSocket
|
# Gorilla WebSocket
|
||||||
|
|
||||||
[![GoDoc](https://godoc.org/github.com/gorilla/websocket?status.svg)](https://godoc.org/github.com/gorilla/websocket)
|
[![GoDoc](https://godoc.org/git.internal/re/websocket?status.svg)](https://godoc.org/git.internal/re/websocket)
|
||||||
[![CircleCI](https://circleci.com/gh/gorilla/websocket.svg?style=svg)](https://circleci.com/gh/gorilla/websocket)
|
[![CircleCI](https://circleci.com/gh/gorilla/websocket.svg?style=svg)](https://circleci.com/gh/gorilla/websocket)
|
||||||
|
|
||||||
Gorilla WebSocket is a [Go](http://golang.org/) implementation of the
|
Gorilla WebSocket is a [Go](http://golang.org/) implementation of the
|
||||||
|
@ -14,11 +14,11 @@ Gorilla WebSocket is a [Go](http://golang.org/) implementation of the
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
* [API Reference](https://pkg.go.dev/github.com/gorilla/websocket?tab=doc)
|
* [API Reference](https://pkg.go.dev/git.internal/re/websocket?tab=doc)
|
||||||
* [Chat example](https://github.com/gorilla/websocket/tree/master/examples/chat)
|
* [Chat example](https://git.internal/re/websocket/tree/master/examples/chat)
|
||||||
* [Command example](https://github.com/gorilla/websocket/tree/master/examples/command)
|
* [Command example](https://git.internal/re/websocket/tree/master/examples/command)
|
||||||
* [Client and server example](https://github.com/gorilla/websocket/tree/master/examples/echo)
|
* [Client and server example](https://git.internal/re/websocket/tree/master/examples/echo)
|
||||||
* [File watch example](https://github.com/gorilla/websocket/tree/master/examples/filewatch)
|
* [File watch example](https://git.internal/re/websocket/tree/master/examples/filewatch)
|
||||||
|
|
||||||
### Status
|
### Status
|
||||||
|
|
||||||
|
@ -28,11 +28,11 @@ package API is stable.
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
go get github.com/gorilla/websocket
|
go get git.internal/re/websocket
|
||||||
|
|
||||||
### Protocol Compliance
|
### Protocol Compliance
|
||||||
|
|
||||||
The Gorilla WebSocket package passes the server tests in the [Autobahn Test
|
The Gorilla WebSocket package passes the server tests in the [Autobahn Test
|
||||||
Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn
|
Suite](https://github.com/crossbario/autobahn-testsuite) using the application in the [examples/autobahn
|
||||||
subdirectory](https://github.com/gorilla/websocket/tree/master/examples/autobahn).
|
subdirectory](https://git.internal/re/websocket/tree/master/examples/autobahn).
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"git.internal/re/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"git.internal/re/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
var upgrader = websocket.Upgrader{
|
var upgrader = websocket.Upgrader{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Chat Example
|
# Chat Example
|
||||||
|
|
||||||
This application shows how to use the
|
This application shows how to use the
|
||||||
[websocket](https://github.com/gorilla/websocket) package to implement a simple
|
[websocket](https://git.internal/re/websocket) package to implement a simple
|
||||||
web chat application.
|
web chat application.
|
||||||
|
|
||||||
## Running the example
|
## Running the example
|
||||||
|
@ -13,8 +13,8 @@ development environment.
|
||||||
Once you have Go up and running, you can download, build and run the example
|
Once you have Go up and running, you can download, build and run the example
|
||||||
using the following commands.
|
using the following commands.
|
||||||
|
|
||||||
$ go get github.com/gorilla/websocket
|
$ go get git.internal/re/websocket
|
||||||
$ cd `go list -f '{{.Dir}}' github.com/gorilla/websocket/examples/chat`
|
$ cd `go list -f '{{.Dir}}' git.internal/re/websocket/examples/chat`
|
||||||
$ go run *.go
|
$ go run *.go
|
||||||
|
|
||||||
To use the chat example, open http://localhost:8080/ in your browser.
|
To use the chat example, open http://localhost:8080/ in your browser.
|
||||||
|
@ -38,7 +38,7 @@ sends them to the hub.
|
||||||
### Hub
|
### Hub
|
||||||
|
|
||||||
The code for the `Hub` type is in
|
The code for the `Hub` type is in
|
||||||
[hub.go](https://github.com/gorilla/websocket/blob/master/examples/chat/hub.go).
|
[hub.go](https://git.internal/re/websocket/blob/master/examples/chat/hub.go).
|
||||||
The application's `main` function starts the hub's `run` method as a goroutine.
|
The application's `main` function starts the hub's `run` method as a goroutine.
|
||||||
Clients send requests to the hub using the `register`, `unregister` and
|
Clients send requests to the hub using the `register`, `unregister` and
|
||||||
`broadcast` channels.
|
`broadcast` channels.
|
||||||
|
@ -57,7 +57,7 @@ unregisters the client and closes the websocket.
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
|
|
||||||
The code for the `Client` type is in [client.go](https://github.com/gorilla/websocket/blob/master/examples/chat/client.go).
|
The code for the `Client` type is in [client.go](https://git.internal/re/websocket/blob/master/examples/chat/client.go).
|
||||||
|
|
||||||
The `serveWs` function is registered by the application's `main` function as
|
The `serveWs` function is registered by the application's `main` function as
|
||||||
an HTTP handler. The handler upgrades the HTTP connection to the WebSocket
|
an HTTP handler. The handler upgrades the HTTP connection to the WebSocket
|
||||||
|
@ -73,7 +73,7 @@ Finally, the HTTP handler calls the client's `readPump` method. This method
|
||||||
transfers inbound messages from the websocket to the hub.
|
transfers inbound messages from the websocket to the hub.
|
||||||
|
|
||||||
WebSocket connections [support one concurrent reader and one concurrent
|
WebSocket connections [support one concurrent reader and one concurrent
|
||||||
writer](https://godoc.org/github.com/gorilla/websocket#hdr-Concurrency). The
|
writer](https://godoc.org/git.internal/re/websocket#hdr-Concurrency). The
|
||||||
application ensures that these concurrency requirements are met by executing
|
application ensures that these concurrency requirements are met by executing
|
||||||
all reads from the `readPump` goroutine and all writes from the `writePump`
|
all reads from the `readPump` goroutine and all writes from the `writePump`
|
||||||
goroutine.
|
goroutine.
|
||||||
|
@ -85,7 +85,7 @@ network.
|
||||||
|
|
||||||
## Frontend
|
## Frontend
|
||||||
|
|
||||||
The frontend code is in [home.html](https://github.com/gorilla/websocket/blob/master/examples/chat/home.html).
|
The frontend code is in [home.html](https://git.internal/re/websocket/blob/master/examples/chat/home.html).
|
||||||
|
|
||||||
On document load, the script checks for websocket functionality in the browser.
|
On document load, the script checks for websocket functionality in the browser.
|
||||||
If websocket functionality is available, then the script opens a connection to
|
If websocket functionality is available, then the script opens a connection to
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"git.internal/re/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -4,8 +4,8 @@ This example connects a websocket connection to stdin and stdout of a command.
|
||||||
Received messages are written to stdin followed by a `\n`. Each line read from
|
Received messages are written to stdin followed by a `\n`. Each line read from
|
||||||
standard out is sent as a message to the client.
|
standard out is sent as a message to the client.
|
||||||
|
|
||||||
$ go get github.com/gorilla/websocket
|
$ go get git.internal/re/websocket
|
||||||
$ cd `go list -f '{{.Dir}}' github.com/gorilla/websocket/examples/command`
|
$ cd `go list -f '{{.Dir}}' git.internal/re/websocket/examples/command`
|
||||||
$ go run main.go <command and arguments to run>
|
$ go run main.go <command and arguments to run>
|
||||||
# Open http://localhost:8080/ .
|
# Open http://localhost:8080/ .
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"git.internal/re/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"git.internal/re/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
var addr = flag.String("addr", "localhost:8080", "http service address")
|
var addr = flag.String("addr", "localhost:8080", "http service address")
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"git.internal/re/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
var addr = flag.String("addr", "localhost:8080", "http service address")
|
var addr = flag.String("addr", "localhost:8080", "http service address")
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
This example sends a file to the browser client for display whenever the file is modified.
|
This example sends a file to the browser client for display whenever the file is modified.
|
||||||
|
|
||||||
$ go get github.com/gorilla/websocket
|
$ go get git.internal/re/websocket
|
||||||
$ cd `go list -f '{{.Dir}}' github.com/gorilla/websocket/examples/filewatch`
|
$ cd `go list -f '{{.Dir}}' git.internal/re/websocket/examples/filewatch`
|
||||||
$ go run main.go <name of file to watch>
|
$ go run main.go <name of file to watch>
|
||||||
# Open http://localhost:8080/ .
|
# Open http://localhost:8080/ .
|
||||||
# Modify the file to see it update in the browser.
|
# Modify the file to see it update in the browser.
|
||||||
|
|
|
@ -14,7 +14,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"git.internal/re/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -143,7 +143,7 @@ func serveHome(w http.ResponseWriter, r *http.Request) {
|
||||||
p = []byte(err.Error())
|
p = []byte(err.Error())
|
||||||
lastMod = time.Unix(0, 0)
|
lastMod = time.Unix(0, 0)
|
||||||
}
|
}
|
||||||
var v = struct {
|
v := struct {
|
||||||
Host string
|
Host string
|
||||||
Data string
|
Data string
|
||||||
LastMod string
|
LastMod string
|
||||||
|
|
Loading…
Reference in New Issue