tail-cf-plugin 0.0.15.pre → 0.0.16.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ module TailCfPlugin
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def listen(loggregator_host, space_id, app_id, user_token)
|
8
|
-
websocket_address = "wss://#{loggregator_host}/tail/spaces/#{space_id}"
|
8
|
+
websocket_address = "wss://#{loggregator_host}:4443/tail/spaces/#{space_id}"
|
9
9
|
websocket_address += "/apps/#{app_id}" if app_id
|
10
10
|
|
11
11
|
websocket_address += "?authorization=#{URI.encode(user_token)}"
|
@@ -13,6 +13,10 @@ module TailCfPlugin
|
|
13
13
|
EM.run {
|
14
14
|
ws = Faye::WebSocket::Client.new(websocket_address, nil, :headers => {"Origin" => "http://localhost"})
|
15
15
|
|
16
|
+
ws.on :open do |event|
|
17
|
+
output.puts("Connected to server.")
|
18
|
+
end
|
19
|
+
|
16
20
|
ws.on :message do |event|
|
17
21
|
received_message = LogMessage.decode(event.data.pack("C*"))
|
18
22
|
output.puts([received_message.app_id, received_message.source_id, received_message.message_type_name, received_message.message].join(" "))
|