#if SECURITY_DEP
-#if MONOTOUCH
+#if MONOTOUCH || MONODROID
using Mono.Security.Protocol.Tls;
#else
extern alias MonoSecurity;
#endif
#if NET_4_5
- [MonoTODO]
public bool IsWebSocketRequest {
get {
- return false;
+ string connection = headers.Get ("Connection");
+ if (connection == null || ! connection.Equals ("upgrade", StringComparison.OrdinalIgnoreCase)) {
+ return false;
+ }
+ string upgrade = headers.Get ("Upgrade");
+ if (upgrade == null || ! upgrade.Equals ("websocket", StringComparison.OrdinalIgnoreCase)) {
+ return false;
+ }
+ return true;
}
}