Last active
August 29, 2015 14:17
-
-
Save oculushut/c481b8159330e0b34a48 to your computer and use it in GitHub Desktop.
Check port on Janus Presence Server on Windows box using Powershell - example for Babylon Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Reference for System.Net.Sockets.TcpClient ==> https://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient(v=vs.110).aspx | |
# Paste parts 1 + 2 and see response from server. Then Paste part 3 to cleanup. | |
#=================== | |
# 1. Get Connected | |
#=================== | |
$tcpClient = New-Object System.Net.Sockets.TcpClient | |
$tcpClient.Connect("babylon.vrsites.com", 5566) | |
$tcpClient.Connected | |
#=========================== | |
# 2. Write data and see response | |
#============================ | |
$stream = $tcpClient.GetStream() | |
$streamWriter = New-Object System.IO.StreamWriter($stream) | |
$streamWriter.WriteLine("{`"method`":`"logon`",`"data`":{`"userId`":`"oculushut`", `"version`":`"39.5`",`"roomId`":`"345678354764987457`"}}") | |
$streamWriter.Flush() | |
Start-Sleep -s 1 | |
$streamReader = New-Object System.IO.StreamReader($stream) | |
$streamReader.readLine() | |
#=========================== | |
# 3. Cleanup | |
#============================ | |
$streamReader.Close() | |
$streamWriter.Close() | |
$stream.Close() | |
$tcpClient.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to alter the URL in this bit if you want to connect to anything other than babylon.vrsites.com: