Dike Jude
Dike Jude

Reputation: 199

Websockets on elixir code

I'm currently creating a chat using elixir. but anytime i try running the app, the websocket gives an error on sever console

The client's requested channel transport version "2.0.0" does not match server's version requirements of "~> 1.0"

And browser console:

WebSocket connection to 'ws://localhost:4000/socket/websocket token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJVc2VyOjMiLCJleHAiOjE1MDQ0OTE1NTQsImlhdCI6MTUwMTg5OTU1NCwiaXNzIjoiU2xpbmciLCJqdGkiOiIyNWY5NDZkNy1jNDg5LTRiYWMtYjJkNS0zZDA4OTdkNDU1ZWMiLCJuYmYiOjE1MDE4OTk1NTMsInBlbSI6e30sInN1YiI6IlVzZXI6MyIsInR5cCI6ImFjY2VzcyJ9.nh-DaQfY8OuI0EBE7lILFx6hjm6J_ZrynXHeOLr1-wM-fXnDakqrZUSN1XFQnr0x0KM9WFOkLEQnip5DcsKxXw&vsn=2.0.0' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Upvotes: 1

Views: 1093

Answers (2)

Milan Jaric
Milan Jaric

Reputation: 5646

your phoenix javascript library (dependency) is updated without notice. You should fix version so it is limited to less than 1.3.0 in package.json (if you are using npm) or bower.json if you are using bower to use old implementation, or use narrowtux solution if you downloaded js file manually. Or upgrade phoenix version.

Upvotes: 1

narrowtux
narrowtux

Reputation: 703

With Phoenix 1.3, a new version of the transport protocol was released. It seems that you've somehow included the new version of the javascript client in your project, but are still running on Phoenix 1.2.

As a workaround, you can copy and reference the old client script here: https://github.com/phoenixframework/phoenix/blob/v1.2/web/static/js/phoenix.js

Upvotes: 0

Related Questions