So I've been in the process of shifting from targeting an ec2 instance directly over to an application load balancer. Doing this, I've had issues connecting to my socket (it was working fine before). All my ALB requests work fine, just the socket being the issue. Here's my setup/config:
My ALB config
My server code
var http = require('http');
var server = http.createServer(function(req, res) {
fs.readFile('./app.html', 'utf-8', function(error, content) {
res.writeHead(200, {"Content-Type": "text/html"});
res.end(content);
});
});
var io = require('socket.io').listen(server);
server.listen(443);
my client code (ios):
NSURL* url = [[NSURL alloc] initWithString:@"https://www.mywebsite.com:443"];
self.socket = [[SocketIOClient alloc] initWithSocketURL:url config:@{@"log": @YES, @"forcePolling": @YES}];
[self.socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
NSLog(@"socket connected");
}];
And finally the error message I'm receiving:
404 Not Found The requested URL /socket.io/ was not found on this server.