2017-06-07 56 views
0

我想對Kubernetes WebSocket的API連接,但我收到此錯誤信息:非法「仲的WebSocket協議」標題:輸入無效「意向書」,預計仲的WebSocket協議

java.lang.IllegalStateException: Message failed with status code 400 Bad Request; Error info: ErrorInfo(Illegal 'sec-websocket-protocol' header: Invalid input 'EOI', expected sec-websocket-protocol (line 1, column 1), 
^) 
    at akka.http.impl.engine.ws.WebSocketClientBlueprint$UpgradeStage$1$$anon$1.onPush(WebSocketClientBlueprint.scala:107) 
    at akka.stream.impl.fusing.GraphInterpreter.processPush(GraphInterpreter.scala:747) 
    at akka.stream.impl.fusing.GraphInterpreter.execute(GraphInterpreter.scala:649) 
    at akka.stream.impl.fusing.GraphInterpreterShell.runBatch(ActorGraphInterpreter.scala:471) 
    at akka.stream.impl.fusing.GraphInterpreterShell.receive(ActorGraphInterpreter.scala:410) 
    at akka.stream.impl.fusing.ActorGraphInterpreter.akka$stream$impl$fusing$ActorGraphInterpreter$$processEvent(ActorGraphInterpreter.scala:603) 
    at akka.stream.impl.fusing.ActorGraphInterpreter$$anonfun$receive$1.applyOrElse(ActorGraphInterpreter.scala:618) 
    at akka.actor.Actor.aroundReceive(Actor.scala:502) 
    at akka.actor.Actor.aroundReceive$(Actor.scala:500) 
    at akka.stream.impl.fusing.ActorGraphInterpreter.aroundReceive(ActorGraphInterpreter.scala:529) 
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526) 
    at akka.actor.ActorCell.invoke(ActorCell.scala:495) 
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) 
    at akka.dispatch.Mailbox.run(Mailbox.scala:224) 
    at akka.dispatch.Mailbox.exec(Mailbox.scala:234) 
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) 
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) 
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) 
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) 

我必須缺少一些配置,你知道這是從哪裏來的?

乾杯

回答

0

挺過來了定義subprotocolchannel.k8s.io

WebSocketRequest(
    uri, 
    extraHeaders = List(token), 
    subprotocol = Option("channel.k8s.io") 
)