添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hi. I noticed that I can no longer connect to wss://live.ctraderapi.com:5036 or wss://demo.ctraderapi.com:5036.

This is the minimal python code to reproduce that

import websockets
import asyncio
async def f():
	async with websockets.connect('wss://demo.ctraderapi.com:5036') as ws:
		print('ctrader connected.')
		await ws.send('test')
		print(await ws.recv())
asyncio.run(f())

Executing this code will get a timeout error, and “ctrader connected.” message was never printed.

The same python code is confirmed to be able to connect to wss://fstream.binance.com/ws.

My C++ code with boost library which used to connect also fails to connect now so this isn't on python or its libraries.

( Updated at: 14 Nov 2023, 06:55 )
RE: Cannot connect to wss://live.ctraderapi.com:5036 or wss://demo.ctraderaip.com:5036

PanagiotisCharalampous said:

Hi there,

We cannot see any problems with the connection at the moment. Can you try to connect using Telnet and let us know the outcome?

Best regards,

Panagiotis

Running telnet demo.ctraderapi.com 5036 gives

Trying 15.197.239.248... 
Connected to demo.ctraderapi.com. 
Escape character is '^]'.

But then further inputting GET /index.html gives no response at all, until Connection closed by foreign host. is printed.

I believe when my C++ code used to be able to connect back then, sending any HTTP request will get a HTTP response back, be it either an error ( the expected response in this test) or an websocket upgrade.

Doing telnet google.com 80 and then GET /index.html gives me the HTTP response and an html.

@popular_jitters056