Container Instances - Running commands and websocket woes

Ephraim Dawson 26 Reputation points
2023-11-01T17:06:40.9833333+00:00

Hi there!

I have been trying to run a command inside my Azure Container via the REST API. The command is rcon-cli which in theory starts a shell where I can run commands into my app. I tested this on the azure portal, and it works perfectly.

I am attempting to use postman to test this, and I have tried JavaScript to no avail. I can make the request to get the WSS url and password, and I can connect using postman, but then what?

Sending the password as plain text, I get

3E 20


which is > in HEX. This is expected to return > so that you can write your command on the >, but sending commands simply echos them back in HEX.

What am I doing wrong here? Thank you!

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
690 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 36,841 Reputation points Microsoft Employee
    2023-11-06T23:03:22.9733333+00:00

    @Ephraim Dawson
    This is a bit outside the scope of what we handle here, you might have better luck tagging this on StackOverflow. Here is my suggestion.

    It seems like you’re trying to interact with the rcon-cli command inside your Azure Container via the REST API using Postman.

    Postman is a good tool for testing APIs, but it might not be the best tool for interactive sessions like the one you’re trying to establish with rcon-cli. Postman is designed to send individual HTTP requests and handle responses, but it doesn’t maintain a persistent connection or interactive session like a shell would.

    If you’re trying to automate the process of sending commands to rcon-cli, you might want to consider using a scripting language to handle the WebSocket connection. Languages like Python or Node.js have libraries that can handle WebSockets and could potentially be used to interact with rcon-cli in a more interactive manner.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.