Closed jakelacey2012 closed 7 years ago
Hello @jakelacey2012, thanks for reporting this issue. This is an undocumented behavior because our golang
server uses the SockJS
to accept connections, therefore the connection is not available via WebSocket
transport which is the default transportClass
of Kite
class.
So you will need to use SockJS
transport class, exported via Kite.transport.SockJS
, here is the example that is working with your case:
import { Kite } from 'kite.js'
const k = new Kite({
// since there is no `websocket` connection, the url starts with http://...
url: 'http://localhost:3636/kite',
// transport layers are exported from `Kite.transport` object, and here we
// are using the SockJS transport class.
transportClass: Kite.transport.SockJS,
})
// and you need to wrap arguments in an array
k.tell('square', [3]).then(data => console.log(data))
Note that, you need to wrap arguments in an array.
The code above will work with the current version, but we are currently in the process of creating version 2
of kite.js
library. One of the plans is to remove the requirement of wrapping arguments in an array.
Awesome thank you for getting back to me @usirin. That seems to have solved the initial connectivity issues. At least this is documented somewhere now :joy:
I'm now getting an error when using the tell method my go server crashes for some reason 😕 , I'll have a look and open a separate issue if I cannot solve.
Again thank you for taking the time :)
I'm getting this issue and I'm not to sure why, could anybody guide me, do I need to configure some extra stuff?
Server works fine...
Client works fine...
If you need me to provide extra information, just let me know I'll get back to you ASAP.