Closed sy92th closed 6 years ago
Sorry I dont know why it would not work specifically for this use case.
Hello JSteunou, It is not connecting to the websocket server.Plz, help me ! Here is my code, componentWillMount() { let msg = '';
const options = { debug: true, protocols: webstomp.VERSIONS.supportedProtocols() }
this.stompClient = webstomp.client("ws://192.168.3.167:8080/test", options)
this.stompClient.connect({}, (frame) => {
console.log("OK")
this.stompClient.subscribe('/topic/greetings', (greeting) => {
msg = JSON.parse(greeting.body);
});
this.setState({ connected: true, message: msg })
}, (err) => console.log(err))
}
and logs...
Opening Web Socket... webstomp.js:243 Web Socket Opened... webstomp.js:243 >>> CONNECT accept-version:1.2,1.1,1.0 heart-beat:10000,10000
Thanks in advance.
Please do not pollute this issue if it is not related. I would like to keep this issue tracker for bugs or feature alike only. If need help try stackoverflow and such, thank you.
I'm trying to connect our server. iOS is working fine but android is getting fail. Please help me here.
Try to use SockJS
const SockJS = require('../libjs/sockjs.min');
const socket = new SockJS(url);
let stompClient = Stomp.over(socket);
// stompClient.debug = () => {};
const headers = {};
stompClient.connect(headers, (frame) => {
console.log("OK");
})
sockJS is depreciated.
Hi JSteunou, my app use last version and client always return Whoops! Lost connection Can you help me ?
Mycode:
const options = {debug: true, protocols: webstomp.VERSIONS.supportedProtocols()};
let client = webstomp.client(url, options);
client.connect({}, function connectCallback(frame){
console.log('OK')
}, (error) => {
console.log('Error');
});
It work very good in ios but in android: Opening Web Socket... Web Socket Opened...