Alternative solution to Java applet - c#

I want to create an architecture as below
Web browser sends an http request. Web server accepts it and returns response to the another port to client machine. Windows service setted up at client machine will accept this reponse and process it.
I want to realize the project via Java applet. But Chrome doesn't support NPAPI. And Firefox also will terminate the support till the end of 2016. Therefore I decided to solve my problem by above way.
How can I realize it?

Related

Get response back from unpingable websites (C# ASP .net mvc)

I'm not a network expert, but for one of my projects, I need to ensure that the website I'm sending the request to is alive. Some websites do not respond to ping; basically, their configuration prevents response to ping requests.
I was trying to Arping instead of pinging websites, but Arping only works on the local network and will not go beyond the network segment (this).
I can download the whole or part of the webpage and confirm if the content is the same as the previous state, but I rather have one more level of confirmation before downloading Html.
Is there any other method that enables the app to get a response back from non-pingable websites outside the network?
Based on common practices you may use ping, telnet and tracert as a client to the requested server (at this point the website or the service you want to connect) and make sure the 3 command are enable to your side. You may also try to access it to your browser.
If its API you may also try to use POSTMAN and call the service.
Goodluck and happy coding :)

Read Client side Serial Port in ASP.NET C#

i need help in reading clients Serial port (COM port) from my web application.
i am able to read it on windows application but if i wants to put it over the web.
is it possible to do so?
I could be wrong, but I don't think it's possible to read a serial port (or indeed any type of port) directly from the browser because there isn't going to be any interface to the underlying system hardware, etc.
However depending on what you need to do there are a couple of options (and probably more that I haven't thought of)
Browser plugin
You could write a browser plugin that can do whatever it wants (within the limitations of a browser plugin of course) and can be used by your webpage by injecting the serial data feed into the page.
The problem with this would maybe having to create plugins for all browsers (assuming you want the web application to run on whatever browser the user chose)
Self-hosted WebAPI in a desktop app
You could embed a self-hosted Web API into either your existing desktop app or a tray application / Windows service, etc, that interfaced with the serial port as you currently do.
This app or service would read the data and "publish" it via a simple JSON-based api that your web app can GET (or could use web sockets to push the data once the initial connection is made by the web app) and could also accept commands from the web browser via POST, etc.
Your web application could then access this via HTTP to get the data and do whatever it liked with it.
Either way, I think the user is going to have to install something to their local system for this to work.

Silverlight can't download clientaccesspolice.xml without running Fiddler

My project consists of 2 parts Silverlight and WindowsForms.
WindowsForm returns data at localhost:8081 or another port.
Data can easily see through the browser by typing the address, with the parameters on all computers.
If Silverlight is enabled on the local server everything works fine, the problems start when you run it on an external server.
On my computer everything works fine, but on some computers, an error is returned "Async_ExceptionOccurred".
Following the network turned out that Silverlight can't get clinetaccesspolice.xml, request has been sent but nothing happens, no error is returned. Of course directly in the browser can open the file.
After turned Fiddler bug disappears on some computers.
It follows that clinetaccesspolice and cross-domain set correctly. Something is blocking communication between Silverlight from external domain and localhost.
I found a solution. Maybe it's not too professional, but solves the problem.
Fiddler share its own engine for developers. Use it in the program used on PC. The engine will automatically change the proxy settings so the client does not need to know anything ;)
Fiddler core
// Call Startup to tell FiddlerCore to begin listening on the specified port,
// and optionally register as the system proxy and optionally decrypt HTTPS traffic.
Fiddler.FiddlerApplication.Startup(8877, true, true);
// Call Shutdown to tell FiddlerCore to stop listening on the specified port, and
// unregister as the system proxy if attached.
Fiddler.FiddlerApplication.Shutdown();

Check to see if Tomcat server is UP from C#

I am working in a multiple server environment and so have created a Management Program to start, stop and open pages on my Tomcat servers.
I want some way to determine from C# whether the server is up at any particular point. I have tried connecting to ports but haven't had any luck. Does anyone know how to do this? Poll a port on an IP address to determine if Tomcat has been bound to it?
What you can do is create a windows service or forms app which uses httpRequests to request a specific page on your tomcat server. This page can for example contain the text "server online"
In the httpResponse class it's possible to read the contents of the returned html code by the server.
If this html contains an error message, your server is probably down or misconfigured,
if it contains the right text, your server is up and running.
You can also try to create a program to check the windows service status for the tomcat service.
Note this will only tell you the service is running, not that it actually works the way it is supposed to.
You have to use JMX in connection with a web service maybe.

How to modify HTTP responses in a different .NET process

I have a standard web server that serve web pages.
I want to monitor traffic on port 80, intercept every http responses, and add/inject an additionnal header to them.
The process will then act like a proxy between the web server and the client.
Could you please give me some pointers? I'm already aware of SharpPCap, but I'm not sure where to start.
Note: I can't rely on the web server, I can't control it or change it's configuration. However I can install any other process on the same machine.
Thanks a million
I think that SharpPCap is an overkill here.
Try:
listen on a port (say 8080)
for each incoming connection, accept and open one to the server (original one, port 80)
pass everything that comes in from the client straight to the server
pass everything that comes from the server back to the client, monitoring the stream and injecting/modifying if needed
I think what you want to do can be done with IIS 7.0 URL Rewrite module instead of rolling your own code.
http://learn.iis.net/page.aspx/711/modifying-http-response-headers/

Categories

Resources