How can I set User-Agent and Referer headers when using ClientWebSocket in .net 4.5?
问题 The obvious answer of using ClientWebSocket.SetHeader throws an exception because it's a protected header: System.ArgumentException occurred Message=The 'User-Agent' header must be modified using the appropriate property or method. Parameter name: name ParamName=name StackTrace: at System.Net.WebHeaderCollection.ThrowOnRestrictedHeader(String headerName) The exception string suggests using a property/method on the ClientWebSocket itself but I can't find any such property/method. It seems this