Network access denied to external node.js socket -
i have 2 servers running on amazon's ec2. 1 standard web server running lamp (this behind elastic load balancer), other node.js server express , socket.io installed. on node server have server.js file (this file automatically loaded on server start).
var app = require('express')(); var server = require('http').server(app); var io = require('socket.io')(server); server.listen(8080); io.on('connection', function (socket) { socket.on('join', function() { console.log('joined'); } } on lamp server, clients connect external server by:
<script src="https://cdn.socket.io/socket.io-1.3.4.js"></script> var socket = io.connect('http://url_here:8080'); socket.on('connect', function() { socket.emit('join', room_id); }); the problem, though, console spits out err_network_access_denied continuously, suggesting access port blocked. however, inbound rules node server follows:
custom tcp rule -- tcp -- 8080 -- 0.0.0.0/0 (anywhere) http -- tcp -- 80 -- ip https -- tcp -- 443 -- ip i have tried sorts more or less opening inbound ports, no avail. may worth nothing way people access client script (the lamp server) through load balancer - cannot directly access lamp server. load balancers inbound rules follows:
custom tcp rule -- tcp -- 8080 -- 0.0.0.0/0 (anywhere) http -- tcp -- 80 -- 0.0.0.0/0 (anywhere) https -- tcp -- 443 -- 0.0.0.0/0 (anywhere) and lamp server's rules:
custom tcp rule -- tcp -- 8080 -- sg-elb_id http -- tcp -- 80 -- sg-elb_id https -- tcp -- 443 -- sg-elb_id ... other irrelevant rules (shh, mysql, ...) has idea why i'd getting access denied error? node server isn't behind load balancer - it's in effect external process. of security groups not restricted in regards outbound rules.
turns out reason couldn't find globally installed express or socket.io modules. doing cd /var/www/html , sudo npm link socket.io sudo npm link express resolved issue.
Comments
Post a Comment