While I serve the app it shows "GET http://114.134.90.66:8080/socket.io/?EIO=3&transport=polling&t=Lu3RCzm net::ERR_CONNECTION_TIMED_OUT "
import {NavController,NavParams} from 'ionic-angular';
import { Component,ViewChild } from '@angular/core';
import {ShowActionSheet} from '../../components/show-action-sheet/show-action-sheet.component';
import * as io from "socket.io-client";
@Component({
templateUrl: 'chat.html'
})
export class ChatPage {
socket: SocketIOClient.Socket;
params: any;
chatBox:any;
messages:Array<any>=[];
name:any;
@ViewChild(ShowActionSheet)
private showActionSheet: ShowActionSheet;
constructor(public nav: NavController, public navParams: NavParams) {
this.params = navParams;
this.name = this.params.get('name');
}
presentActionSheet(actionSheetType) {
this.showActionSheet.presentActionSheet(actionSheetType);
}
private send(text){
this.connect();
this.chatBox=text;
this.messages.push(this.chatBox);
this.chatBox='';
}
connect() {
this.socket=io('http://114.134.90.66:8080');
this.socket.on('connect', function () {
console.log("SOCKET CONNECTED");
});
}
}
I have no idea why isn’t it working. I have successfully installed typings.