func NewTransport(name string, config config.Config) Transport {
	originCheck := config.CheckOrigin

	switch name {
	case WebsocketType:
		readBufferSize := config.WebsocketReadBufferSize
		writeBufferSize := config.WebsocketWriteBufferSize
		enableCompression := config.PerMessageDeflate

		return NewWebsocket(readBufferSize, writeBufferSize, enableCompression, originCheck)
	case PollingType:
		flushLimit := config.PollingBufferFlushLimit
		receiveLimit := config.PollingBufferReceiveLimit

		return NewPolling(flushLimit, receiveLimit, originCheck)
	default:
		return nil
	}
}
// NewTransport creates a transport of the selected type
NewTransport creates a transport of the selected type
// NewTransport creates a transport of the selected type
func NewTransport(name string, config config.Config) Transport {
	originCheck := config.CheckOrigin
	switch name {
	case WebsocketType:
		readBufferSize := config.WebsocketReadBufferSize
		writeBufferSize := config.WebsocketWriteBufferSize
		enableCompression := config.PerMessageDeflate
		return NewWebsocket(readBufferSize, writeBufferSize, enableCompression, originCheck)
	case PollingType:
		flushLimit := config.PollingBufferFlushLimit
		receiveLimit := config.PollingBufferReceiveLimit
		return NewPolling(flushLimit, receiveLimit, originCheck)
	default:
		return nil
	}
}
func NewTransport ( name string , config config . Config ) Transport { originCheck := config . CheckOrigin switch name { case WebsocketType : readBufferSize := config . WebsocketReadBufferSize writeBufferSize := config . WebsocketWriteBufferSize enableCompression := config . PerMessageDeflate return NewWebsocket ( readBufferSize , writeBufferSize , enableCompression , originCheck ) case PollingType : flushLimit := config . PollingBufferFlushLimit receiveLimit := config . PollingBufferReceiveLimit return NewPolling ( flushLimit , receiveLimit , originCheck ) default : return nil } }
NewTransport creates a transport of the selected type
NewTransport creates a transport of the selected type