Skip to content

How to set Cross domain origin?  #194

Closed
@gunsluo

Description

@gunsluo

in AcceptOptions struct, I found the InsecureSkipVerify field and set it equal to true. but all clients can connect to the WebSocket server, it includes illegal clients. in gorilla have CheckOrigin. but there is no the same method. (AcceptOrigins and add AcceptInsecureOrigin is removed in the current version).


	// InsecureSkipVerify disables Accept's origin verification behaviour. By default,
	// the connection will only be accepted if the request origin is equal to the request
	// host.
	//
	// This is only required if you want javascript served from a different domain
	// to access your WebSocket server.
	//
	// See https://stackoverflow.com/a/37837709/4283659
	//
	// Please ensure you understand the ramifications of enabling this.
	// If used incorrectly your WebSocket server will be open to CSRF attacks.
	InsecureSkipVerify bool

@nhooyr How to set origin like gorilla's CheckOrigin? Looking forward to your reply, appreciate it. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions