ฉันกำลังพยายามทดสอบการเชื่อมต่อซ็อกเก็ตใบเรือจากมอคค่า
var socketIOClient = require('socket.io-client');
var sailsIOClient = require('sails.io.js');
// Instantiate the socket client (`io`)
// (for now, you must explicitly pass in the socket.io client when using this library from Node.js)
var io = sailsIOClient(socketIOClient);
// Set some options:
// (you have to specify the host and port of the Sails backend when using this library from Node.js)
io.sails.url = 'http://localhost:1337';
มันทำให้เกิดข้อผิดพลาด
ข้อผิดพลาดที่ไม่ได้รับการตรวจสอบ: ไคลเอนต์ socket.io (io) ที่ให้มาได้ถูกเพิ่มลงในอินสแตนซ์ SDK ซ็อกเก็ต Sails แล้ว (มี io.sails)
ฉันทำอะไรผิดหรือเปล่า? sails เวอร์ชัน 0.12.3, socket.io-client 1.4.6