How to connect to CloudFoundry’s Loggregator directly via WebSockets

Firstly make sure you can run the standard CloudFoundry cli: cf logs [APP_NAME] Then turn on tracing: export CF_TRACE=true You will see a HTTP request and then it will switch to a secure WebSocket: WEBSOCKET REQUEST: [2015-04-22T11:27:22+01:00] GET /tail/?app=[APP_GUID] HTTP/1.1 Host: wss://loggregator.[YOUR_CF_DOMAIN]:443 Upgrade: websocket Connection: Upgrade Sec-WebSocket-Version: 13 Sec-WebSocket-Key: [HIDDEN] Origin: http://localhost Authorization: [PRIVATE DATA […]