-
-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Describe the bug
I packed an ASP.NET application that consumes HuobiSocketClient into Docker image and hosted it locally using docker-compose. The same code works well outside of Docker. Also, REST API forks well from Docker. The issue is only with WSS connection.
Same approach work successfully with other exchanges from CryptoExchange.Net EXCEPT: Huobi, Kucoin, OKX
To Reproduce
Just try to establish socket connection from Docker container.
docker-compose.yml
huobi.server:
container_name: huobi.server
build:
context: .
dockerfile: ./MyProjectName/Dockerfile
ports:
- "5006:5006"
environment:
- "ASPNETCORE_ENVIRONMENT=Production"
- "ASPNETCORE_URLS=http://+:5006"
networks:
- customNetwork
Some code from program.cs
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(options => options.ListenAnyIP(5006, o => o.Protocols = HttpProtocols.Http1AndHttp2AndHttp3));
var app = builder.Build();
app.UseWebSockets();
app.Run();
Expected behavior
Connection should be established successfully.
Debug logging
Error while establishing connection:
{"Code":null,"Message":"Can't connect to the server","Data":null}
Metadata
Metadata
Assignees
Labels
No labels