Socket.io , apirest and ionic

Hello! I have a api rest made in codeigniter which brings me a get type query and wants it to be actialize in real time with Socket, try it and I get an error. If someone can help me I would be so thankful .

import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import { URL_SERVICIOS } from '../../config/url.servicios';
import {  OnInit } from '@angular/core';
import * as io from 'socket.io-client';


@Injectable()
export class PedidosProvider {

  pedidos:any[]=[];
    socketHost:string='http://localhost:8100';
    // socket: SocketIOClient.Socket;
socket:any;
  constructor(public http: Http) {
    this.socket = io.connect(this.socketHost);
    this.socket.on('connect', () => {
       this.datos_Pedidos();


    });


    console.log('Hello PedidosProvider Provider');

   //
  }



  datos_Pedidos(){
		let url= URL_SERVICIOS+"pedidos/pedido";
	   this.http.get(url).map(resp=> resp.json()).subscribe(data=> {
		  console.log(data);
		  if(data.error){
		  }else{
			this.pedidos.push(...data.ordenes);
		  }
      });
      // this.socket.emit('new message', 	this.pedidos);
	  }

}
/*-->URL_SERVICIOS= http://maribelpata18.000webhostapp.com/index.php/<-- */

Is it possible not to use socket locally in ionic that works when the AAP is installed in the cell?

image

I don’t see how a target of localhost makes any sense. If you install this app on a device, what would be listening on the device’s port 8100?

Can you give me an example please as should be the code with apirest, ionic and socket.io.

It’s the first time I use it

This is the url

URL_SERVICES = “http://maribelpata18.000webhostapp.com/index.php/”;