Documentation
¶
Index ¶
- Constants
- type PeerJSServer
- func (PeerJSServer) CaddyModule() caddy.ModuleInfo
- func (pjs *PeerJSServer) Cleanup() error
- func (pjs *PeerJSServer) FillDefault() error
- func (pjs *PeerJSServer) Provision(ctx caddy.Context) error
- func (pjs *PeerJSServer) ServeHTTP(w http.ResponseWriter, req *http.Request, h caddyhttp.Handler) error
- func (pjs *PeerJSServer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (pjs *PeerJSServer) Validate() error
- type ZapLoggerWrapper
- func (z *ZapLoggerWrapper) Debug(msg string, id string)
- func (z *ZapLoggerWrapper) DebugWithError(msg string, id string, err error)
- func (z *ZapLoggerWrapper) Error(msg string, id string, err error)
- func (z *ZapLoggerWrapper) Info(msg string, id string)
- func (z *ZapLoggerWrapper) TraceExpireCheck(msgs map[string]utils.Iterable[msgstorage.IMessage])
- func (z *ZapLoggerWrapper) TraceMessage(id string, msg *protocol.Message)
- func (z *ZapLoggerWrapper) Warn(msg string, id string, err error)
Constants ¶
View Source
const ENABLE_TRACE bool = false
View Source
const WS_PATH string = "peerjs"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerJSServer ¶
type PeerJSServer struct {
// Path (string). The server responds for requests to the root URL + path.
// E.g. Set the path to /myapp and run server on 9000 port via peerjs --port 9000 --path /myapp Then open http://127.0.0.1:9000/myapp - you should see a JSON reponse.
// Default: "/"
Path string `json:"path,omitempty"`
// Connection key (string). Client must provide it to call API methods.
// Default: "peerjs"
Key string `json:"key,omitempty"`
// The amount of time after which a message sent will expire, the sender will then receive a EXPIRE message (milliseconds).
// Default: 5000
ExpireTimeout time.Duration `json:"expire_timeout,omitempty"`
// Timeout for broken connection (milliseconds).
// If the server doesn't receive any data from client (includes pong messages), the client's connection will be destroyed.
// Default: 60000
AliveTimeout time.Duration `json:"alive_timeout,omitempty"`
// Maximum number of clients' connections to WebSocket server
// Default: 64
ConcurrentLimit uint `json:"concurrent_limit,omitempty"`
// [Additional] Maximum number of messages in the queue for each client
// Default: 16
QueueLimit uint `json:"queue_limit,omitempty"`
// Allow to use GET /peers http API method to get an array of ids of all connected clients
AllowDiscovery bool `json:"allow_discovery,omitempty"`
// [Additional] Other MesseageType (`type`) in protocol.Message that allowed to be transmitted
TransmissionExtend []string `json:"transmission_extend,omitempty"`
// [Additional] Allow to use GET /id http API method to get a new id
ClientIdManagerRaw json.RawMessage `json:"client_id_manager,omitempty" caddy:"namespace=http.handlers.peerjs_server inline_key=id_manager"`
// contains filtered or unexported fields
}
func (PeerJSServer) CaddyModule ¶
func (PeerJSServer) CaddyModule() caddy.ModuleInfo
func (*PeerJSServer) Cleanup ¶
func (pjs *PeerJSServer) Cleanup() error
Cleanup implements caddy.CleanerUpper.
func (*PeerJSServer) FillDefault ¶
func (pjs *PeerJSServer) FillDefault() error
func (*PeerJSServer) Provision ¶
func (pjs *PeerJSServer) Provision(ctx caddy.Context) error
Provision implements caddy.Provisioner.
func (*PeerJSServer) ServeHTTP ¶
func (pjs *PeerJSServer) ServeHTTP(w http.ResponseWriter, req *http.Request, h caddyhttp.Handler) error
ServeHTTP implements caddyhttp.MiddlewareHandler.
func (*PeerJSServer) UnmarshalCaddyfile ¶
func (pjs *PeerJSServer) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
peerjs_server [<matcher>] {
[path <string>]
[key <string>]
[expire_timeout <duration>]
[alive_timeout <duration>]
[concurrent_limit <uint>]
[queue_limit <uint>]
[allow_discovery [<bool>]]
[transmission_extend <string>...]
[id_manager <subdirective>]
}
func (*PeerJSServer) Validate ¶
func (pjs *PeerJSServer) Validate() error
Validate implements caddy.Validator.
type ZapLoggerWrapper ¶
type ZapLoggerWrapper struct {
// contains filtered or unexported fields
}
func (*ZapLoggerWrapper) Debug ¶
func (z *ZapLoggerWrapper) Debug(msg string, id string)
Debug implements peerjs_server.IFunctionalLogger.
func (*ZapLoggerWrapper) DebugWithError ¶
func (z *ZapLoggerWrapper) DebugWithError(msg string, id string, err error)
DebugWithError implements peerjs_server.IFunctionalLogger.
func (*ZapLoggerWrapper) Error ¶
func (z *ZapLoggerWrapper) Error(msg string, id string, err error)
Error implements peerjs_server.IFunctionalLogger.
func (*ZapLoggerWrapper) Info ¶
func (z *ZapLoggerWrapper) Info(msg string, id string)
Info implements peerjs_server.IFunctionalLogger.
func (*ZapLoggerWrapper) TraceExpireCheck ¶
func (z *ZapLoggerWrapper) TraceExpireCheck(msgs map[string]utils.Iterable[msgstorage.IMessage])
TraceExpireCheck implements peerjs_server.IFunctionalLogger.
func (*ZapLoggerWrapper) TraceMessage ¶
func (z *ZapLoggerWrapper) TraceMessage(id string, msg *protocol.Message)
TraceMessage implements peerjs_server.IFunctionalLogger.
Click to show internal directories.
Click to hide internal directories.