Unable to connect to the signalr hub when it is hosted in webserver - signalr

im bugged up with a issue in SignalR and breaking my head for the past 10 days.
I have the hub as a self host in a console application. It works fine when it is hosted in the local system as follows
$.connection.hub.url = 'http://localhost:8080/signalr';
$.connection.hub.logging = true;
$.connection.hub.start()
.done(function () { alert("Now connected!"); })
.fail(function () { alert("Could not Connect!"); });
The problem is when i host it in the server and try to access the hub url as
$.connection.hub.url = 'http://www.domainname.com:8080/signalr';
it always says could not connect.
if i browse the page in the server machine and try to connect the hub as localhost it works fine but unable to connect as domainname
i have done all the steps.
Added the port 8080 in the firewall
I have run the console app as admin
in the console app, i have given the server url as *:8080
please help me. im breaking my head now. is there anything that i need to enable in the server. the server is windows 2008 R2

Related

Conecting MQTT server from Meteor Galaxy

My application uses the perak/meteor-mqtt-collection package to connect to an MQTT server running on IP XX.XX.XX.XXX. Locally it works fine, but on galaxy it doesn't. It just doesn't seem to be connected to the MQTT server. Do I need any particular configuration to connect to another server?
Meteor.startup(() => {
let server = "mqtt://XX.XX.XX.XXX";
...
Events.mqttConnect(server, arrayTags, { insert: true });
});

Meteor on iPad 'Could not connect to the server sockjs' error

i have this meteor app deployed on iPad
when my meteor app is starting i have this error
Failed to load resource: Could not connect to the server sockjs
this error doesn't occur when i am debugging the same application on my browser
it is quite wired because i never had it before and plus i am not connecting to any meteor server but just connecting to a regular websocket (later).
and i use
Meteor.startup(function() {
Meteor.disconnect();
}
what should i change?

Deploy Go webserver to Google compute engine

I just started to test Google compute engine. Now I'm trying to deploy my Go (golang) application on it, so that it can be reached from outside. I use compute engine in favor of the app engine, since my application requires a MongoDB database.
I did the following:
create compute engine instance
setup up firewall so that port 1234 is open and IP is static
install MongoDB
upload my application
start
The application starts just fine. But I cannot reach it from outside if I open it in my browser with ip:1234. I also tried to start it on port 80 as root user, but this didn't work neither.
The server is configured as following:
{
"host": "localhost:1234",
"dbhost": "localhost",
"db": "dbname",
"logfile": "log"
}
When I'm using an apache server it servers port 80 and the page is displayed... OS is ubuntu 14.04.
The main simply adds some handlers to a mux and adds a FileServer to the public dir:
mux.Handle("/", http.FileServer(http.Dir(public_dir)))
// [...]
if err := http.ListenAndServe(cfg.Host, mux); err != nil {
panic(err)
}
So what's the issue here?
Try changing host from localhost to 0.0.0.0, because right now it's only listening to "inside" requests.

SignalR self hosting with owin

I want to create an signalr app that will be self hosted using Owin, so to start off i tried to run the sample that is on https://github.com/SignalR/SignalR/wiki/Self-host. But when i run the application and then navigate to /signar/hubs i get a 500 Server error. I get the same exception when i try to connect from my client app.
Do i need to add something else apart from what is in the sample code? or does anyone know of a good tutorial?
Things to check if trying to access from an external connection:
Are you hosting the server on all addresses or just localhost?
// use http://*:8080 to bind to all addresses.
string url = "http://localhost:8080";
Make sure to run app as administrator.
Also, is the Windows firewall blocking the port you are using? I had to add an exception to allow incoming TCP connections on that port.

EC2- non responding http requests

I just installed my node.js app in a windows micro instance with security group quick-start and with http port enabled.
I opened the firewall in the instance and opened port 80, 443 for inbound and outbound both.
In spite of that, my http requests are not being honored by the node.js app.
From log I see that the app is connected to redis and mongo and socket.io is also started.
What's wrong ? why http requests are blocked ?
Have you by chance built your app on top of the Example Webserver as currently shown on the Node.js home page as well? The sample currently looks like so:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
Either way your Node.js server might simply not be listening on the correct port/hostname combination - the Example Webserver listens on port 1337 (rather than the regular HTTP port 80) and on localhost only (rather than on the private/internal IP address which has been assigned to your EC2 instance) for example.
If these assumptions apply, you could achieve you goal by adjusting the listen() statement accordingly, see my answer to the related question Node.js Amazon EC2 example webserver - no result for an extended discussion, including a couple of variations regarding the flexible use of the server.listen(port, [hostname], [callback]).
Good luck!
Finally found the problem.
I introduced log4js and integrated this with express, as,
app.use(log4js.connectLogger(logger, { level: log4js.levels.ERROR }));
This created the problem. Somehow this was failing. Looks like it works only with DEBUG. After commenting this, it started working. Strange !!

Resources