I need to talk to an external server that only accepts TCP connections and doesn't support HTTP connections. I know the IP address and the port since the service is running on a Linux box I have in a Virtual Machine on Azure. What I can't figure out is how to do this from a WebMatrix 3 project since it only supports .NET 4.0, not .NET 4.5, and 4.5 has the assemblies that support TCP client work.
I've tried to use the WebSocket4Net NuGet package, installed into WebMatrix 3, but I'm not sure connecting as a client TCP socket is what it does. When I try connecting to the server using code like this (note, the URL is fake except for the "ws:" protocol prefix, the only prefix WebSocket4Net seems to support):
WebSocket4Net.WebSocket("ws://myazuredns.cloudapp.net:6721");
ws.Open();
The connection times out. I know that the service at the foreign web site is active since I checked many times that the service is listening on the right port using netstat. How can I do TCP client socket work from a WebMatrix 3 project?
Related
I have a local MAC machine that RDPs into a windows VM. On that windows VM/desktop I have Power BI Desktop installed along with the Cdata PowerBI/Quickbooks ODBC driver (https://www.cdata.com/drivers/quickbooks/download/powerbi/).
On a separate server (which I can RDP into from the virtual machine) I have quickbooks desktop installed (https://www.acecloudhosting.com/) and in single-user mode (opened a company file w/ an admin user). On that server I have also setup QuickBooks Remote Connector (http://remoteconnector.com/), which essentially is used to create an authenticated connection to QuickBooks. This "remote connector" also acts as a lightweight web server that listens for incoming requests (such as a power bi direct query) and uses that to communicate with Quickbooks hosted on a separate server.
However, I keep getting an HTTP protocol error and not sure if it is because the ports are not setup properly or if something in my ODBC connection is incorrect. It is very odd that I can RDP into the remote server from my VM, but when I try to ping the server my request time out despite allowing ICMP responses in the windows file sharing options so I find that odd.
I have worked on this for about 4 hours, but have run out of things to try.
http://cdn.cdata.com/help/RQB/odbc/pg_connectiono.htm
I have a single Windows application (.NET) on serving as a server and communicating with the database. I also have client Windows applications (.NET) which communicate with the server application. Pretty standard so far.
As of now, I am using the IP address of the server, say "192.168.1.114", which I enter in my client software to establish the link. For instance, "http://192.168.1.114".
Now, I am trying to change that connection to HTTPS. Is there any way I can do that without actually changing the codebase? (I don't have the source code)
Any IIS certificate? Require SSL? Machine Key? Binding? Anything! I just want those packets to not be transmitted with regular HTTP.
Thank you so much, dear Community.
I deployed an Asp.Net Web API project on Amazon Web Services' Elasticbeanstalk (IIS configured machine). Everything works fine except WebSocket. To test the WebSocket easier I use Simple WebSocket Client extension on Chrome.
When I make a request to the API, I get the following (error) message (I observe this message over developer console's network tab):
WebSocket connection to 'ws://my_url' failed: Error during WebSocket handshake: Unexpected response code: 400
I have not found enough information to overcome this problem.
I tried enabling all Inbound/Outbound TCP connections from all ports and all IPs under Security Groups.
I tried creating an empty Asp.Net Web API project that only has a basic sample of WebSockets (just sending a message to the connected user) and deploying it to a brand new environment and application on AWS.
Nothing has worked so far.
I am using Microsoft's WebSockets, .NET Framework 4.5.1.
What are the possible solution ways?
If you are using AWS Elastic Load Balancer in your elastic beanstalk then ELB does not support web sockets and you have to apply a work around. Change your Load Balancer top classic load balancer that supports Websockets.
https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
I solved the problem by adding All TCP on Inbound segment of Security Groups and using the IP address of the server instead of AWS created name.
I try to make a push service that runs on port 80 (or 443). These are the only ports that has inbound rules on firewall (for now).
My server is windows server 2008 r2 and has IIS installed on it.
The question is whether can I run my SignalR app with owin (self host) on port 80 ? Will it be confllicted with the IIS ? Or is it possible to run my signalr on top of IIS and thus my IT won't change firewall configuration? or, another possibility is to install another vm that has no IIS installed on it and then I can use port 80 freely?
Thanks
You can definitely host SignalR application in IIS. It should be enough to just poblish finished application to website in IIS. SignalR wil then be located under this website.
Following this tutorial should be enough to get you started: http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr
I have an ASP.NET project (VS2008 on Windows 7 with either webforms, MVC1, or MVC2 -- all the same result for me) which is just the File->New hello world web project. It's using the default ASP.NET development server, and when I start the server with F5, the browser never connects and I get a timeout. I tried to debug this by telnetting to the development server's port while it was running, and I got the same result:
C:\Users\farmercs>telnet localhost 54752
Connecting To localhost...Could not open connection to the host, on port 54752:
Connect failed
I can see in the system tray that the server thinks it's running, and a netstat -a -n command shows that there is indeed an active TCP listener on that port.
This worked in the not-too-distant past, and I could work on web projects using the development server. One thing that has changed since then was that I installed the Microsoft Loopback Adapter to accommodate a local development Oracle installation. I'm not sure this is the problem, but it seems a likely culprit.
I also tried to hit the port using the server name itself (http://mycomputername:54752) but with the same result.
So, what could be blocking me from connecting? And if it's the loopback, then what is a good way for me to retain my ability to connect to my development Oracle server while still being able to use the ASP.NET development server?
have you checked your host file?
%SystemRoot%\windows\system32\drivers\etc\host
look if there is any redirection of localhost or 127.0.0.1 to somewhere else rather than your pc