I have a basic chat socket.io node.js application working on the localhost of a Windows server running Windows 7.
Node and Socket.io installed without any issue and when I run my application through RDC to the windows server, the socket works perfectly.
What I'm struggling with is how i access the socket e.g. "socket.io/socket.io.js" externally.
I would have assumed it would be rather than "localhost:8000/socket.io/socket.io.js" it owuld be "{server_ip}:8000/socket.io/socket.io.js" however this does work.
I saw some discussion about iisnode, but it seems that sockets arent supported yet with that implementation.
Any suggestions?
You can use socket.io with iisnode, however you will not be able to use the websockets transport since IIS 7 does not support websockets. You must explicitly configure your iisnode-hosted socket.io server to use the xhr-polling transport instead.
It turned out to be a firewall issue that was blocking access to that port which my hosting company managed to resolve for me so I'm using socket.io in the normal manner through a node command prompt.
Thanks for the advice, I did try Iisnode and like you said found that sockets weren't supported.
Related
I have developed a Jooby-Application which is hosted on a netty server. I can access the application on localhost and tests were fine. Now I want to make the app accessable over internet and dont know what is the best way to reach this goal?
The complete application is hosted on a Windows Server, because it uses Excel. (Read/Write over Apache POI. For macros it has to be Windows) Should I try to connect the running netty-server with IIS or can I just forward the requests from outside to localhost? The last mentioned approach propably is a bad idea regarding security issues.
It works with reverse proxy over IIS. I had to install some features like Application Request Routing and URL Rewrite. Then I can start the jooby application (netty server) as usual on a specific port at localhost and set a reverse proxy to it.
I am not sure why being on a window is necessary, anyways, Netty is just a Java network programming framework, it can run on any platform where Java is installed.
You need to host a server, you can buy a VPS, install windows as OS, install Java, you can run your application as you like.
What I understand is you need to test it, for that you can use any port forwarding service like https://pagekite.net/support/intro/features/ to enable "world access" to localhost
I've to design a solution that permits to read real-time data generated by local sensors through a remotely-hosted web application.
The design is still work in progress: the sensors' data could be handled by a windows application/service installed on the client machine, or by some external hardware (like a raspberry) located on the same network of the client machine.
Now, I'm very new to WebSockets, but they seems exactly what I need for providing real-time data via browser.
My question is: can a remote web application open a WebSocket to a server that is located on the same local network which the client belongs to?
Is solution B possible? How can I achieve that?
For example, I'd like the server to be located on the client localhost. Sensors would send data to the local windows service, and the web application would show them by opening a WebSocket to localhost (client localhost, not server localhost!).
Well, I did some testing and the answer is yes, it is possible.
Test setup:
A web page hosted on a remote server, with a WebSocket client which connects to 'localhost'.
WebSocket server running on my pc.
It worked.
We're having a weird problem at work and I'm hoping someone here can give me some ideas on how to troubleshoot it.
The problem is that I cannot make websocket connections from my Kubuntu 13.10 workstation. I've tried from both Chrome and Firefox. I'm behind a proxy and first I thought that must be the reason. However, I got some coworkers to try to connect to the same websocket echo demo and all of them were able to, except one. He was the only one running Ubuntu (same as me), the others were on Mac, Windows and even one on RedHat! Theirs all worked fine.
Ok, so now for the really weird part. I created and ran a virtual machine on my workstation (the one that couldn't connect). The VM is a Lubuntu 13.10 and what do you know, the darn thing establishes a websocket connection just fine!
So any ideas on how to troubleshoot this or even some suggestions for solutions would be very much appreciated.
Ugh... well that one was dumb.
So it turns out that in Linux you can check a checkbox in your Network Proxy settings (the system settings) that will use the same proxy for all protocols.
Yeah... don't do that!
Unless, that is, your proxy server supports SOCKS as well as HTTP/HTTPS/FTP (highly unlikely).
It turns out that if you check that checkbox, your proxy server will be registered as a SOCKS proxy and for some reason, websocket connections in both Chrome and Firefox will want to use that. So your HTTP proxy will end up getting a bunch of weird SOCKS handshakes that it doesn't understand and any websocket connection will fail.
This was tested on both Ubuntu and Kubuntu and the "problem" exists on both.
TL;DR; Don't check the "Use this proxy server for all protocols" checkbox unless your proxy server supports the SOCKS protocol. Instead, manually fill in the same server for the different protocols (http, https and ftp) but leave the socks protocol empty (or point to an actual socks proxy server).
I'm developing a program using Windows 7. There are WCF services (soap, rest) that are used by currently by Silverlight but very soon I'll start development of the mobile application that would make use of these services.
On day to day basis I use Mac and Apache to host my website, but during the development of this program I would like to use IIS7 to put my services online. I have absolutely no problems to access all the services via localhost but as soon as I'm trying to connect through the internet I get "The connection has timed out".
I'm sure that my router is configured right as it works perfectly fine when I'm on Mac OS, but it looks like Windows simply blocks incoming connections from outside; I cannot even connect from another computer on the same network.
So is there a way of using Windows 7 as server with IIS7 or is it only possible with Windows Server? I know it might be like enabling/disabling one setting somewhere but I just cannot find it.
Please help.
By default, the Windows 7 firewall doesn't have a port 80 exception for IIS, you will need to either add an exception or disable the firewall to be able to connect from another machine.
Windows has a built-in firewall that is probably blocking the connections. Type "firewall" into the control panel search box to find the settings to allow stuff through/turn it off completely.
I will be building a server/client software on Windows, where many machines need to communicate with a Postresql database running on the server. This is C++ software so I will use libpq to connect to the database.
If I do this, will there be issues with the firewall? I'd like to make configuration as easy as possible and not have users open up firewall ports or disable their firewall.
If I do need to open up firewall ports, can I use WCF to get around the issue? Basically send a command to the server using WCF, run the postgresql command locally, and get the result back (I have never used WCF but understand that it can communication using HTTP port 80).
PostgreSQL typically listens on port 5432, which is not open by default in the Windows firewall. But the only machine where the firewall would need to be re-configured is the one where PostgreSQL is running. If you have many client machines, none of them should require firewall changes (unless they have restrictions on outbound traffic, which is rare).
Hope this helps.
You can also configure SSL connections to ensure better security.