ReubenBond / hanbaobao-web

Orleans sample application with Kubernetes hosting
MIT License
141 stars 33 forks source link

Remote access API use Intranet IP #3

Open Jeff-Feng2022 opened 2 years ago

Jeff-Feng2022 commented 2 years ago

I would like to call the api endpoint from another machine , http://127.0.0.1:5000/api/Search?query=monkey. I know when we use UseLocalhostClustering(), it only support listening to localhost or 127.0.0.1. it cannot call use intranet ip address. so i change to use UseDevelopmentClustering

siloBuilder.UseDevelopmentClustering (new IPEndPoint(IPAddress.Parse("192.168.31.224"), 11111)) .Configure(options => { options.ClusterId = "dev"; options.ServiceId = "hanbaobao"; }) .ConfigureEndpoints(siloPort: 11111, gatewayPort:5000);

and i call the endpoint use http://192.168.31.224:5000/api/Search?query=monkey but fail with below information. could you help me?

info: Orleans.Networking[0] Closing connection with remote endpoint 192.168.31.224:59108. Exception: System.InvalidOperationException: Remote connection sent preamble length of 542393671, which is greater than maximum allowed size of 1024. at Orleans.Runtime.Messaging.ConnectionPreamble.Read(ConnectionContext connection) at Orleans.Runtime.Messaging.GatewayInboundConnection.RunInternal() at Orleans.Runtime.Messaging.Connection.Run() System.InvalidOperationException: Remote connection sent preamble length of 542393671, which is greater than maximum allowed size of 1024. at Orleans.Runtime.Messaging.ConnectionPreamble.Read(ConnectionContext connection) at Orleans.Runtime.Messaging.GatewayInboundConnection.RunInternal() at Orleans.Runtime.Messaging.Connection.Run() info: Orleans.Networking[0] Connection Local: 192.168.31.224:5000, Remote: 192.168.31.224:59108, ConnectionId: 0HMI8JKBFEB92 terminated

Jeff-Feng2022 commented 2 years ago

@ReubenBond could you help me on this. thank you so much