Improve check origin documentation

Remove the example code to disable origin checks from the documentation.
I am concerned that developers are copying the code without
understanding the security implications of the code. Most applications
should not use this code.

Change the bad origin error message to mention Upgrader.CheckOrigin

Mention cross-site request forgery in the Upgrader.CheckOrigin doc.
2 files changed
tree: d0475dc94da8800996bc3ed3b6efcf0d9bc44031
  1. examples/
  2. .gitignore
  3. .travis.yml
  4. AUTHORS
  5. client.go
  6. client_clone.go
  7. client_clone_legacy.go
  8. client_server_test.go
  9. client_test.go
  10. compression.go
  11. compression_test.go
  12. conn.go
  13. conn_broadcast_test.go
  14. conn_read.go
  15. conn_read_legacy.go
  16. conn_test.go
  17. doc.go
  18. example_test.go
  19. json.go
  20. json_test.go
  21. LICENSE
  22. mask.go
  23. mask_safe.go
  24. mask_test.go
  25. prepared.go
  26. prepared_test.go
  27. proxy.go
  28. README.md
  29. server.go
  30. server_test.go
  31. util.go
  32. util_test.go
  33. x_net_proxy.go
README.md

Gorilla WebSocket

Gorilla WebSocket is a Go implementation of the WebSocket protocol.

Build Status GoDoc

Documentation

Status

The Gorilla WebSocket package provides a complete and tested implementation of the WebSocket protocol. The package API is stable.

Installation

go get github.com/gorilla/websocket

Protocol Compliance

The Gorilla WebSocket package passes the server tests in the Autobahn Test Suite using the application in the examples/autobahn subdirectory.

Gorilla WebSocket compared with other packages

Notes:

  1. Large messages are fragmented in Chrome's new WebSocket implementation.
  2. The application can get the type of a received data message by implementing a Codec marshal function.
  3. The go.net io.Reader and io.Writer operate across WebSocket frame boundaries. Read returns when the input buffer is full or a frame boundary is encountered. Each call to Write sends a single frame message. The Gorilla io.Reader and io.WriteCloser operate on a single WebSocket message.