zhu733756 zhu733756 例子:https://github.com/emicklei/go-restful/blob/v3/examples/cors/restful-CORS-filter.go。你这里没看见ws,调试下看看。
zhu733756 lgy 是的。我看restful-go里支持正则匹配的好像只有allowDomains? https://github.com/emicklei/go-restful/blob/9a7f6a77df00efe4deb90e64af9b9cbb2550daf3/cors_filter.go#L23 https://github.com/emicklei/go-restful/blob/9a7f6a77df00efe4deb90e64af9b9cbb2550daf3/cors_filter.go#L137 建议你debug下吧。可能是写法不对。