Excel office addin + React - Security Error with websockets - websocket

I've been trying to create an excel addin with React. I'm trying to connect it to a websocket server but I keep getting this vague error: Error: SecurityError due to this line this.client = new WebSocket('ws://localhost:6789').
Is there a way to disable this security? The addin is using the IE/Edge browser to host the runtime process.

Related

Can a Blazor API project share the same localhost endpoint with the client?

As far as I can tell, the model for creating a Blazor client application is to have one project for the client and another for the server. The Microsoft template shows an async call to get data, but it's just a download of a static JSON file. Any real application would need to call an API.
So I have a separate API project for this. But that project has a different localhost endpoint for debugging, and this is causing a CORS nightmare for me. My call from client to server isn't really cross-site, except for this debugging problem, so I don't want to do a ton of work figuring out CORS.
How can I get the Blazor client and web api server to run off the same localhost (or alias) domain, so that the client can make same site requests?
Yes.
When you create a new Blazor Web Assembly app there is a tick box for hosting it in ASP.NET.
If you tick that checkbox then you'll get a server that both serves the client page (via _Host.cshtml) and also responds to web api calls.

Rabbitmq management UI issue with Firefox

I'm trying to use rabbitmq management UI on Firefox, getting this error:
An error occurred during a connection to localhost:15671. SSL peer was unable to negotiate an acceptable set of security parameters. Error code: SSL_ERROR_HANDSHAKE_FAILURE_ALERT
This works for me on Chrome.
Version Details:
Rabbitmq-3.6.5
Erlang-19.0
Firefox-48.0
This is not an rabbitMQ UI issue.its browser level certification problem.You need to update that thing.
Firefox displays this error "ssl_error_handshake_failure_alert" means that you do not have valid personal certificates in your browser. You can obtain new ones by going to http://ist.mit.edu/certificates and clicking on Get MIT Personal Certificate.
Please refer this link https://support.mozilla.org/en-US/questions/728969 to get full knowledge about this

CRM dynamics web api (400) Bad Request

I have a crm dynamics plugin that makes a web api call but I am getting the following error:
The remote server returned an error: (400) Bad Request
I am using the following code
using (WebClient client = new WebClient())
{
string URI = "http://myserver/api/myaction";
string myParameters = string.Format("param1={0}", param1);
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
string HtmlResult = wc.UploadString(URI, myParameters);
}
}
When I profile and debug this with the Plugin Registration tool the web api call returns a valid result and does not error.
Any ideas what is causing this infuriating issue?
UPDATE:
The plugin is running in sandbox mode and is on premise.
We have tried using async HttpClient but this requires the referencing of additional dlls which causes it own issues (adding the dlls to the GAC/ ILMerge) hence trying to get a working solution with WebClient initially which requires no additional dll referencing.
The issue turned out to be caused by an IIS binding issue.

How can I access my server webapi project from by client javascript project in Visual Studio

I have a VS 2012 solution with a web api server project and a javascript-html client project. I can test my web api with Fiddler. I can test from another test project using HttpClient, but because I have the server and the client running on separate ports in IIS Express, I have some kind of CORS issue because when I try to make an ajax call from the client I get a 405 method not allowed error.
I have added the suggested custom header entries to my web.config and applicationhost.config files that should allow cross origin access.
There must be some simple solution to this that everyone uses, but it seems to escape me.
I found the answer here. I had to add the nuget package for system.web.http.cors and the web api took care of everything. Didn't need to touch my client side javascript.

How to Mimic Server Down(503) With Windows 8 Phone Emulator, IIS Express, Web Api?

Does anyone know how to get a 503 error to occur when doing a call from code in a windows phone application.
I tried by not running my web api project and just loading up and doing a call to that project but it just comes back 403 and not 503.
You can throw the 503 error with this line of code in your WebAPI controller:
throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.ServiceUnavailable, "Service unavailable");

Resources