Online server for desktop app - implement as web-server or custom socket application? - client-server

A bit of a generic question but let's say you have a desktop app that allows a user to connect to a central server and provides functionality like:
Login
Ability to auto-download profile data on login
Download and uploading save files through the app
A web-server (JSP/ASP.NET/PHP/etc) would do lots of work for you especially on the request-serving and threading front, but it seems a bit of a cheat for a desktop app to use HTTP requests like this.
All thoughts welcome. Maybe this should be community wiki?

If you want to leave things open for other possibilities in the future, go with a web server. That way, if you decide to write a web-based version of your desktop app (or an iPhone/Pre/Android application), you don't have to rewrite your socket server. Almost everything can speak HTTP these days.

Related

What is the capability of PWA for Windows?

I'm totally new to PWA (rather I'm still considering adopting PWA or go Electron).
Looking at the concept and guides of the app on the web, it seems that the capability of it is to this extent, thus;
Access web APIs securely and easily
Yes, as it is the alternative implementation of web apps.
Access local storage of the PC for the app
Yes, through HTML5 web storage.
Access any local files in the PC
No?
Communicate with another desktop app through TCP connection
Yes? By posting/getting some query to localhost for example?
Obtain system info like PC status or installation path of another desktop app
No?
How many of my understandings are correct? Is there another capability or limitation to be specially noted?

Communication between Chrome javascript and native Windows code

I need to have a communication channel between my web application that runs on Chrome, and a native code on Windows. I need to run a native code when JS requests and pass the results back from native code. The environment is totally managed so I can set trusts and group policies, etc.
I can think of preparing a small web service that runs locally (and allows CORS) and call this service from javascript, but in this case i need to run this code forever.
Any advices will be very helpful. If it is possible i can try Windows registry write/read, pipes, shared memory, MMF or any other way to do it.
Thanks
There's a way to communicate with local processes without using an extension. Websockets aren't restricted to communicating with the same domain as the web page, they can communicate with a WebSocket server on localhost. You have to wrap your native code in a WebSocket server, libraries are available for that though.
Another method is Native Messaging, but it requires a browser extension:
Native messaging enables a WebExtension to exchange messages with a
native application installed on the user's computer.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Native_messaging
https://developer.chrome.com/extensions/nativeMessaging

How to identify computer which I have redirected

I have the following problem to solve:
I few months ago I startet a website where you can watch youtube videos which aren't available in your country. Everythings works fine but now I want to offer a new method where I route all the requests directly over my server. Therefore I will later use a custom DNS-Server. Right now I use the hosts file for testing but I have really no idea how i can identify the user. I can promp the user user to login on a website but I will that it works systemwide so if he use a youtube downloader for example it have to work there either and not only in the browser where I could use a session system with cookies. I want a solution where the user can identify himself once in a time like a website or something like this but how can my server detect if this is a user which is logged in or if he is not?
There are several ways that this could be accomplished with varying levels of difficulty.
standard proxy server over https. Your service could simply be a proxy server and then every "client" would update their browser to point to your proxy server. You could also simplify this by using a proxy PAC file (proxy auto config).
An anonomyzing interface. The end user would not be able to use their standard search tools etc, instead they would have to use a web page much like what google translate does.
A browser plugin. There are already firefox plugins which do something similar to this. They change the way that the browser resolves DNS. This may be the best bet for you but would require development work.
An actual install utility that you have your users install on their machines which update the dns servers.

Integrated Windows Authentication - Realistic for internet applications?

I'm reading about how wonderful Integrated Windows Authentication is, but there is only a few comments about how it's only good for intranets. So just to be clear, is it safe to say that this technology is not realistic for internet applications? I'm developing a desktop application that connects with SQL Server and I just can't imagine telling all my customers to configure a windows account on their home PCs according to my specifications. Am I missing somethimg because that seems quite unrealistic.
(of course, where the DBA has a close relationship with the users on an intranet, it's a different story.)
I would have to say yes, Windows Authentication is best left to intranet applications - it's ideal for any authenticated communication that needs to take place on the same network.
It sounds like you want to allow the desktop app (running on your client's machine) to directly talk with your SQL Server? I would strongly recommend against allowing direct public access, especially if you cannot lock the port down to a list of known IP addresses. Instead, consider putting WCF Web Services between the database and the desktop client.

Internet Access Controller using .net ( vb or c# )

I want to develop a software which restricts users internet access using vb6 or vb.net.
This is not a baby sitter program but
1) whenever a client machine takes any browser it should ask for username and password.
2)There should be option for adding new users at the server side application.
can anyone suggest any name of such a software. or some sites where I can get some help
on the same..
You could implement a HTTP proxy using sockets. You would turn off internet connection sharing on your server and configure the other machines to connect to the web via your proxy.
I would recommend going for an off the self solution e.g. in a router rather than building something from scratch.
If you are dead set on using VB6 you could make use of the winsock control. Here is a project using winsock to serve files. You could modify it to become a multithreaded proxy server instead. It will be a tough challenge though.
http://www.codeproject.com/KB/IP/winsock.aspx

Resources