How do make a Websocket connection for a Python Rust+ API Wrapper

Viewed 397

Ok, so i would like to access the Rust+ API for the game Rust. There is currently no API wrapper written in python, only in JavaScript however i have no idea how to write javascript.

This is the module: https://github.com/liamcottle/rustplus.js

And i had a look through it but i have no clue, as far as i was aware they are doing nothing differently when opening the socket? That may just be me being stupid!

I wondered if anyone could give any insight?

I tried this code with a random server:

import asyncio
import websockets

async def main():

    async with websockets.connect("ws://onegrid.projectnova.gg:25584") as websocket:

        returnData = await websocket.recv()
        print(returnData)

asyncio.get_event_loop().run_until_complete(main())

However it errors:

Exception has occurred: ConnectionRefusedError
[WinError 1225] The remote computer refused the network connection

I wondered if anyone could help, or give a few pointers!

1 Answers
Related