Skip to content

Commit

Permalink
Improvements for the WebSockets library
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOnlyArtz authored and kustosz committed Sep 21, 2018
1 parent 8d9c359 commit 3501458
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stdlib/Std/src/WebSockets.luna
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ class WebSocket:
# `wss` part of the url, you must explicitly call `setSecure` to override
# the defaults. Example usage:
# ```
# conn = WebSocket.connection "ws://somehost.com/sockets" . setPort 12345 . create
# conn = WebSocket.connection "ws://somehost.com" "/sockets" . setPort 12345 . create
# stream = conn.stream
# # process the incoming stream...
# conn.close
# ```
def connection host:
def connection host path:
secure = host.startsWith "wss"
port = if secure then 443 else 80
WebSocketInstance host port "/" secure
WebSocketInstance host port path secure

# Create a simple, broadcast server that recieves messages from its clients
# and can send messages to all of the clients at once.
Expand Down

0 comments on commit 3501458

Please sign in to comment.