Skip to content

Commit

Permalink
fixbug websocket
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Packard <nguyenphong.mobile.engineer@gmail.com>
  • Loading branch information
NguyenPhongVN committed Jan 26, 2022
1 parent 60f08c0 commit fdbb1c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file not shown.
6 changes: 3 additions & 3 deletions Sources/MSocket/SwiftWebSocket/SwiftWebSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final public class SwiftWebSocket {

public init(urlRequest: URLRequest? = nil,
@RequestBuilder builder: () -> RequestBuilderProtocol) {
self.urlRequest = urlRequest ?? URLRequest(url: URL(string: "https://")!)
self.urlRequest = urlRequest ?? URLRequest(url: URL(string: "wss://")!)
self.parameter = builder()
parameter.build(request: &self.urlRequest)
socket = WebSocket(request: self.urlRequest)
Expand All @@ -26,13 +26,13 @@ final public class SwiftWebSocket {
}
}

func write(string: String?, completion: (() -> ())? = nil) {
public func write(string: String?, completion: (() -> ())? = nil) {
if let string = string {
socket?.write(string: string, completion: completion)
}
}

func write(data: Data?, completion: (() -> ())? = nil) {
public func write(data: Data?, completion: (() -> ())? = nil) {
if let data = data {
socket?.write(data: data, completion: completion)
}
Expand Down

0 comments on commit fdbb1c9

Please sign in to comment.