-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected response code: 200 at client.cli/open-connection #1
Comments
The general answer to this is 'your endpoint isn't what you think it is'. That could mean the socket isn't what you think it is or more likely your routing isn't what you think it is. If you are not using the defaults for some reason, you need to make your own handler and routes using hanasu/src/clj/aerial/hanasu/server.clj Line 80 in 16b8cdd
as shown here: and used here: |
Thank you for your reply and for the repo The project I am working on uses a custom handler and I think it should work. (def main-ring-handler
(-> my-routes
(ring.middleware.defaults/wrap-defaults ring.middleware.defaults/site-defaults)
(wrap-cljsjs)
(wrap-gzip))) where (defroutes my-routes
(GET "/" req (response/content-type
{:status 200
:session (if (session-uid req)
(:session req)
(assoc (:session req) :uid (unique-id)))
:body (io/input-stream (io/resource "oz/public/index.html"))}
"text/html"))
...) Started the server with (srv/start-server 10666 :main-handler main-ring-handler) Edit:
|
I get an unexpected response code error when I use
cli/open-connection
. The error is thrown inws/connect url {...}
atin
haslett.client.
The error thrown is
Expected behaviour
A connection to an already running clojure-side server would go through to enable sending of messages between both sides.
The server starts successfully from the clojure side.
Actual behaviour
Error
Error during WebSocket handshake: Unexpected response code: 302
I am using aerial.hanasu v0.2.3
What could the problem be or is this an issue for haslett?
The text was updated successfully, but these errors were encountered: