UWP cannot connect to local Socket.IO server - c#

I have an UWP application which is connecting to a Socket.IO server. When debugging I like it to be a local server, but I can't get it to connect it. I use the SocketIoClientDotNet library, and it works well if I have to connect to an external server, but I can't connect to the local one.
I'm aware that on default UWP apps forbids connecting to local servers, I think it's called loopback, but I'm also tried to go around that by using this tool:
http://loopback.codeplex.com/
However, It didn't helped.
Any help is much appreciated, and thanks in advance! : )

I think the problem is that you didn't enable the relevant capability in your project. Please open the manifest of your app can select the Capabilities label and check the Private Networks (Client & Server) on the left.
This capability's name is "privateNetworkClientServe", this capability provides inbound and outbound access to home and work networks through the firewall.
For more info about capabilities, you can refer to App capability declarations.
Update:
Due to loopback restrictions enforced by network isolation policy, when use TCP protocol, server and client must run on separate machines for them to be able to communicate with each other.

Related

NancyFx - Find the server over a local network

Scenario: I have a small POS system running in a brick-and-mortar store. The software is running in Windows machines with SQL Server 2008 - 2012 (it varies). There are Android tablets that need to connect to the server in someway to get the data inside SQL Server.
My plan right now is to create some REST Web services using NancyFx and host them as a Windows Service inside the Windows machines. Then the Android tablets will need to connect to the server via HTTP in order to consume the REST API.
I have a problem (perhaps more than one): the network in the brick-and-mortar store is not that reliable and the Wi-Fi signal might decrease for whatever reason.
Question: Is there a way to automatically find the IP or machine name of the server (the one with the REST API) even if these properties change for some reason (unknown network issues or so)?
Yes, the server and the tablets are going to be on the same local network.
it's more of a network problem than programming issue. you must have a DHCP server installed in your LAN. use that to assign an IP to the server with a fixed lease. that way you fix the address of server. clients should preferably connect to that server using its name. since it's a Windows network, name would resolve to the ip address.
that is the simplest solution i can think of

IIS permissions to open sockets inside unmanaged DLL

I'm developing a .NET MVC Application to query a PLC for inputs and outputs status using Snap7 library.
For development reasons I connect to my PLC (behind a router) using an SSH tunnel bound to a localhost port, so it becomes reachable at 127.0.0.1:102 address. In this scenario, everything works fine and I manage to read data from the device.
When I deploy my application to the production server a subtle problems begins: I'm no longer able to connect PLC. Error code from Snap7 library is cryptic and the only difference in code is the IP address (192.168.1.100:102 instead of localhost:102) so I suspect a permission problem is involved.
I'm searching for two solutions to my problems: one for the normal deployment, where I have full access to IIS Server and one for Azure deployment. I'm searching for something to put inside Web.config but I'm not still able to find suitable configurations or workarounds.

Connecting to SQL Azure database from client applications

I have a bunch of small desktop applications for which I have a simple database for keeping user data (who uses which app and in which version) etc.
I want the apps to connect to Azure SQL server and update database record when they're started. My apps have the ADO.NET connection string hardcoded in them.
It works fine from my home network and my company guest network - however, the corporate network has got some of the ports disabled, and that apparently includes port 1433. As per Microsoft troubleshooting guide, I tried telnet and failed.
C:\Users\xxx>telnet 65.55.74.144 1433
Connecting To 65.55.74.144...Could not open connection to the host, on port 143
: Connect failed
I cannot connect neither via my applications, nor by SQL Server explorer in Visual Studio.
So, the question is - how can I get around this problem? It is highly doubtful that corporate IT will unlock a port just because I ask, besides I want to keep it as simple, low profile and independent as possible. Or maybe my approach is incorrect from the very beginning and I should do stuff differently?
Cheers
Bartek
You can't.
Make your desktop applications talk to web services instead, over HTTP/HTTPS. Among other things this will also allow a more controlled access (right now anyone can connect to your database and modify the data, since your access credentials are publicly shared with your app).
A side effect of using we services is that 80/443 are almost always opened in all corp firewalls.

Client/Server Application That Can Deploy Client From Server

I have a client-server application written in c#. I am hoping someone can give some direction on where to look in order to set it up where a user could connect to the server from their workstation, most likely through http but that's not a requirement, and download the client. The mechanism would need the following features:
Check for updates on client startup and automatically apply them.
Allow multiple clients (connected to different servers) to download on the same machine
Client can be downloaded by a non-local admin
Possibly install any prerequisites needed on the workstation
I currently use ClickOnce but it isn't quite working out. Currently the server sits in IIS and uses WCF services.

Can C# block internet access on a remote Windows PC

Using C#, is it possible to iterate over a list of remote Windows computers connected to the LAN and turn on/off internet access for specific PCs only and while the internet connectivity is provided via a router? And all that without installing any client software on the remote PCs.
This answer might better be served as a comment, but it is a little long to write there.
You should look into creating a Group Policy.
This is what our local Network Administrator does.
We have hundreds of PCs out on our production floor that have to connect to our network to access data over the local server and server at our remote plants.
These PCs access our network via a Public profile, which does not have Internet access.
We also employ multiple servers (applications server, mail server, web server, sql server, etc).
When the Public account is logged in, the router denies traffic to the web server.
If a manager or supervisor needs to look up a part out on the production floor, they can log in with their account (i.e. not the Public account) and access Internet information.
Lucky for me, you did not ask HOW to do this, because I am not really sure how this is done. You only asked if it was possible.

Categories