在 wss://ws.luno.com/api/1/stream/:pair 上作为客户端连接到 ssl web socket
Connect to ssl web socket as a client on wss://ws.luno.com/api/1/stream/:pair
我正在尝试连接到 wss://ws.luno.com/api/1/stream/:pair
说明位于页面底部的https://www.luno.com/en/api
我已成功 运行 从
接受的答案
但是当我替换 url
String url = "wss://ws.luno.com/api/1/stream/:pair";//"wss://qa.sockets.stackexchange.com/";
和 运行 我再次得到以下异常
2018-10-06 12:07:08.690:WARN:twl.SecureClientSocket:WebSocketClient@1717159510-17:
org.eclipse.jetty.websocket.api.UpgradeException: 404 Not Found
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:522)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:202)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:194)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:470)
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:416)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:316)
at org.eclipse.jetty.http.HttpParser.handleContentMessage(HttpParser.java:599)
at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1669)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1517)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:172)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:135)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:422)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:306)
at org.eclipse.jetty.io.ssl.SslConnection.succeeded(SslConnection.java:160)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:680)
at java.lang.Thread.run(Thread.java:748)
2018-10-06 12:07:08.696:WARN:twl.SecureClientSocket:main:
java.util.concurrent.ExecutionException: org.eclipse.jetty.websocket.api.UpgradeException: 404 Not Found
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at trading.websocket.luno.SecureClientSocket.main(SecureClientSocket.java:32)
Caused by:
org.eclipse.jetty.websocket.api.UpgradeException: 404 Not Found
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:522)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:202)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:194)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:470)
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:416)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:316)
at org.eclipse.jetty.http.HttpParser.handleContentMessage(HttpParser.java:599)
at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1669)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1517)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:172)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:135)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:422)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:306)
at org.eclipse.jetty.io.ssl.SslConnection.succeeded(SslConnection.java:160)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:680)
at java.lang.Thread.run(Thread.java:748)
欢迎提出任何建议
为了回答我自己的问题,我使用的 websocket URL 是错误的,(wss://ws.luno.com/api/1/stream/:pair
)。我需要用货币对替换 :pair
,例如XBTZAR
.
我正在尝试连接到 wss://ws.luno.com/api/1/stream/:pair
说明位于页面底部的https://www.luno.com/en/api
我已成功 运行 从
但是当我替换 url
String url = "wss://ws.luno.com/api/1/stream/:pair";//"wss://qa.sockets.stackexchange.com/";
和 运行 我再次得到以下异常
2018-10-06 12:07:08.690:WARN:twl.SecureClientSocket:WebSocketClient@1717159510-17:
org.eclipse.jetty.websocket.api.UpgradeException: 404 Not Found
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:522)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:202)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:194)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:470)
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:416)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:316)
at org.eclipse.jetty.http.HttpParser.handleContentMessage(HttpParser.java:599)
at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1669)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1517)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:172)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:135)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:422)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:306)
at org.eclipse.jetty.io.ssl.SslConnection.succeeded(SslConnection.java:160)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:680)
at java.lang.Thread.run(Thread.java:748)
2018-10-06 12:07:08.696:WARN:twl.SecureClientSocket:main:
java.util.concurrent.ExecutionException: org.eclipse.jetty.websocket.api.UpgradeException: 404 Not Found
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at trading.websocket.luno.SecureClientSocket.main(SecureClientSocket.java:32)
Caused by:
org.eclipse.jetty.websocket.api.UpgradeException: 404 Not Found
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.onComplete(WebSocketUpgradeRequest.java:522)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:202)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:194)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:470)
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:416)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:316)
at org.eclipse.jetty.http.HttpParser.handleContentMessage(HttpParser.java:599)
at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1669)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1517)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:172)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:135)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:73)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:133)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:155)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:422)
at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:306)
at org.eclipse.jetty.io.ssl.SslConnection.succeeded(SslConnection.java:160)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
at org.eclipse.jetty.io.ChannelEndPoint.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
at org.eclipse.jetty.util.thread.QueuedThreadPool.run(QueuedThreadPool.java:680)
at java.lang.Thread.run(Thread.java:748)
欢迎提出任何建议
为了回答我自己的问题,我使用的 websocket URL 是错误的,(wss://ws.luno.com/api/1/stream/:pair
)。我需要用货币对替换 :pair
,例如XBTZAR
.