Giter Club home page Giter Club logo

Comments (4)

Almost-Done avatar Almost-Done commented on May 22, 2024 1

There were a couple missing functions that socket.io needs (get/set headers, clearTimeout).

I implemented those in the develop/fix-socket-io and I got the chat sample working with this code:

    var serverIP = 'http://127.0.0.1';
    var messagePort = '3000';
    var socket = io.connect(serverIP + ':' + messagePort);

    socket.on('chat message', function (msg) {
        console.log(data);
    });

Can you please give it a try and let me know if it works for you?

from holojs.

Almost-Done avatar Almost-Done commented on May 22, 2024

Is socket.io using WebSockets? Is yes, then there's some work to be done to implement support for them in the native layer. If not, then this could be an easy fix in the XHR implementation.

from holojs.

bryanbocao avatar bryanbocao commented on May 22, 2024

Partially.

"Note: Socket.IO is not a WebSocket implementation. Although Socket.IO indeed uses WebSocket as a transport when possible, it adds some metadata to each packet: the packet type, the namespace and the ack id when a message acknowledgement is needed. That is why a WebSocket client will not be able to successfully connect to a Socket.IO server, and a Socket.IO client will not be able to connect to a WebSocket server (like ws://echo.websocket.org) either. Please see the protocol specification here."
from https://github.com/socketio/socket.io/

Socket IO protocol:
https://github.com/socketio/socket.io-protocol

from holojs.

bryanbocao avatar bryanbocao commented on May 22, 2024

In app.js, when I run

var serverIP = 'http://127.0.0.1'; // This should be the IP address that's assigned by your router
var messagePort = '8000';
console.log(serverIP);
var socket = io(serverIP + ':' + messagePort);

I got the message from Output window in Visual Studio 2015:

log: http://10.100.200.104
Exception thrown at 0x77062502 in threejsapp.exe: Microsoft C++ exception: Js::JavascriptExceptionObject at memory location 0x01EC9CA4.
'threejsapp.exe' (Win32): Loaded 'C:\Windows\System32\urlmon.dll'. Symbols loaded.
'threejsapp.exe' (Win32): Loaded 'C:\Windows\System32\mlang.dll'. Symbols loaded.
Exception thrown at 0x77062502 in threejsapp.exe: Microsoft C++ exception: Js::JavascriptExceptionObject at memory location 0x01ECCCC4.
Exception thrown at 0x77062502 in threejsapp.exe: Microsoft C++ exception: Js::JavascriptExceptionObject at memory location 0x01EC99BC.
Failure in file c:\users\bryanbo.cao\documents\repos\ar-collaboration\src\holojs\holojs\holojshost\objectevents.h, line 52
Failure in file c:\users\bryanbo.cao\documents\repos\ar-collaboration\src\holojs\holojs\holojshost\windowelement.cpp, line 149
Failure in file c:\users\bryanbo.cao\documents\repos\ar-collaboration\src\holojs\holojs\holojshost\windowelement.cpp, line 149
Failure in file c:\users\bryanbo.cao\documents\repos\ar-collaboration\src\holojs\holojs\holojshost\windowelement.cpp, line 149
Failure in file c:\users\bryanbo.cao\documents\repos\ar-collaboration\src\holojs\holojs\holojshost\windowelement.cpp, line 149
Failure in file c:\users\bryanbo.cao\documents\repos\ar-collaboration\src\holojs\holojs\holojshost\windowelement.cpp, line 149

But on the server which is running on another laptop, I could see that a new client was connected.

from holojs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.