c# - How to connect the socket.io with backend -
i trying implement chat in ionic project have tried far connect socket.io backend (c#) below.
here index.html
<script src="http://192.xxx.x.xxx:8888/socket.io/socket.io.js"></script>
and here created socketservice.js file looks
var example = angular.module('starter.socketservice',[]) example.service('socketservice',function(socketfactory){ console.log("socketservice"); return socketfactory({ iosocket: io.connect('http://192.xxx.x.xxx:8888') }); console.log(socketfactory); })
finaly created folder called server have chat-server.js file in there.
var io = require('socket.io')(8888); console.log(io); io.on('connection', function(socket){ console.log(socket); socket.on('send:message', function(msg){ console.log(msg); socket.emit('message', msg); console.log("success"); }); });
error:
get http://192.xxx.x.xxx:8888/socket.io/socket.io.js net::err_connection_timed_out
what have done worng there have connect server getting error
can 1 tell me step step explaination in c# develop socket.io
Comments
Post a Comment