Lin CS Lin CS - 1 year ago 181
Node.js Question

Some problems about the raw-socket in Node.js

My operating system is Windows 10 Version 10586 and node.js is Version 4.4.5.

When I use the module raw-socket follow the example in this page

When running code like this:

var raw = require ("raw-socket");
var socket = raw.createSocket ({protocol: raw.Protocol.None});

I got following error:

this.wrap = new raw.SocketWrap (

Error: ��һ�ַ���Ȩ�޲������ķ�ʽ����һ�������׽��ֵij��ԡ�

at Error (native)
at new Socket (C:\Users\KEEY\node_modules\raw-socket\index.js:47:14)
at Object.exports.createSocket (C:\Users\KEEY\node_modules\raw-socket\index.js:202:9)
at Object.<anonymous> (C:\Users\KEEY\Desktop\node\raw-socket\demo.js:2:18)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
[Finished in 0.2s with exit code 1]

How to solve it?

Answer Source

Thanks for everyone's help. I email Stephen Vickers,the author of the module raw-socket,the source of problem is that

Stephen Vickers: 
   It looks like you don't have permissions to open raw sockets on that platform.

Then I run it as administrator, it works! Thank you,Stephen Vickers

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download