From 077de023459abc5d0cb8a120e18b49c9b7f492e7 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 24 Nov 2016 08:15:17 -0500 Subject: [PATCH 1/2] remove namespace from socket id --- Source/SocketIOClient.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SocketIOClient.swift b/Source/SocketIOClient.swift index 6a30ad0..4f56613 100644 --- a/Source/SocketIOClient.swift +++ b/Source/SocketIOClient.swift @@ -65,7 +65,7 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable var waitingPackets = [SocketPacket]() public var sid: String? { - return nsp + "#" + (engine?.sid ?? "") + return engine?.sid } /// Type safe way to create a new SocketIOClient. opts can be omitted From b1debdf91204a6254d4780edda8ef764be9995b6 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 18 Dec 2016 20:06:12 -0500 Subject: [PATCH 2/2] bump ws, fix #598 --- Source/SSLSecurity.swift | 2 +- Source/WebSocket.swift | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/SSLSecurity.swift b/Source/SSLSecurity.swift index d2a2b78..4d2c60a 100644 --- a/Source/SSLSecurity.swift +++ b/Source/SSLSecurity.swift @@ -26,7 +26,7 @@ public protocol SSLTrustValidator { func isValid(_ trust: SecTrust, domain: String?) -> Bool } -open class SSLCert { +open class SSLCert : NSObject { var certData: Data? var key: SecKey? diff --git a/Source/WebSocket.swift b/Source/WebSocket.swift index 108592d..3bdff34 100644 --- a/Source/WebSocket.swift +++ b/Source/WebSocket.swift @@ -162,6 +162,11 @@ open class WebSocket : NSObject, StreamDelegate { public init(url: URL, protocols: [String]? = nil) { self.url = url self.origin = url.absoluteString + if let hostUrl = URL (string: "/", relativeTo: url) { + var origin = hostUrl.absoluteString + origin.remove(at: origin.index(before: origin.endIndex)) + self.origin = origin + } writeQueue.maxConcurrentOperationCount = 1 optionalProtocols = protocols }