Socket io request getting blocked - reactjs

While connecting to my socket.io server from react app, request is getting blocked. Its working with localhost but when i am trying from VPS, its not working.
From VPS:
From localhost:
http://server_ip:8007/socket.io/?EIO=4&transport=polling
above url returning valid response 0{"sid":"VaHqLXI5UVRRaeUAAAAV","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":20000,"maxPayload":1000000}

The error ("mixed block") seems to say, you must connect using HTTPS to localhost when hosting files from an HTTPS server. Meaning, should use wss:// instead of ws://. Or connect to your vps host using http:// protocol not https://.

Related

Http to Https Redirecting failing on Node Express server

I am new to React and Express. The thing that I am trying to do is auto redirect all existing requests from HTTP to HTTPS. I want this redirection to be done automatically so clients does not need to change anything. In Express I am running Http on port 3000 and then running my application on port 3001 over HTTPS with valid certificates. When testing locally, I am able to see the redirection happening whereby http gets changed to https and port changes from 3000 to 3001 . So I passed http://localhost:3000 which got modified to https://localhost:3001. But when I deploy to my application server, when clients request for http://example.com:3000 , only the protocol changes from http to https but port no does not change. Its like https://example.com:3000. I want to know why the port number does not get changed as well. Strange thing is when I do curl -X GET http://example.com:3000 it says found and redirecting to https://example.com:3001. Had been struggling for while on this.
I am expecting both protocol and port number should reflect in browser rather only protocol changes but port number is not getting changed

Unable to access mule-worker external URL from clients network

I have a mule application deployed on cloudhub. My client is trying to trigger the mule-worker URL (http://mule-worker-appname.us-e2.cloudhub.io:8081) from his network (connecting to their VPN), but it is giving Timed Out error. However, when he tries to hit with SLB URL (http://appname.us-e2.cloudhub.io) he is getting the response.
When client disconnects his VPN then worker URL is also working.
Can someone explain why the worker url is not working where as SLB url is working? I thought worker external url is a public url and can be accessed, then why there is a restriction from their network? Is there some firewalls that client must be having?
When accessing the worker directly (ie using http(s)://mule-worker-myappname.region.cloudhub.io:port) you have to add explicitly the default HTTP (8081) or HTTPS (8082) ports to the request. Example: `http://mule-worker-testapp.us-e2.cloudhub.io:8081)
Also if in the VPC firewall those ports are blocked of access from anywhere (ie public Internet access) you may not be able to access.

Andvanced REST Client ignores a custom Host header

I am testing my proxy that simply sends a client's request to a proxied server and returns a response back. The current realization requires that the client must send the fully prepared valid request to the proxy (the Host header value must match with a DNS of the predefined in source code proxied server).
Heres my custom request to the proxy that proxies a www.example.com:
But the result request that ARC sends to the localhost is:
GET / HTTP/1.1
Host: localhost:1234
connection: close
then it is sent to the www.example.com but the Host header is invalid for it so 404 is returned as a result.
I just noticed that this refers to the old version of ARC for Chrome. Support for Chrome apps is scheduled to end soon the the app is no longer supported. Instead, please, install desktop client from https://install.advancedrestclient.com/
To move your data from one app to another follow instructions from https://docs.advancedrestclient.com/moving-from-chrome-application-to-desktop-client

React WebSocket on server, Error during WebSocket handshake

I have made an application that uses a WebSocket. I want to run this application on a PLESK Server, but I get this error message 'WebSocket connection to 'wss://sub.domain.com/' failed: Error during WebSocket handshake: Unexpected response code: 404' when I visit the website.
After reading a few blogs, I came to the conclusion you have to adjust something in the NGINX settings, but this also appears to have no effect, or I have to do it wrong, that is also possible. (Another blog)
At the moment our API is installed on a subdomain (with the NodeJS add-on in plesk) and it also works. As soon as I start up the files locally I can connect to the WebSocket and the API so it must be up to the PLESK Server I think. At this moment only the NGINX 'Proxy mode' is off and the 'Additional nginx directives' empty.
Perhaps one of you is familiar with this problem?

Apigility and https

I got a problem with apigility and https.
To enable https communication between AngularJs frontend and Apigility backend, I used this tutorial:
http://robsnotebook.com/xampp-ssl-encrypt-passwords. Almost everything works fine, but REST webservices doesn't respond via https.
When, using Advanced REST Client, I'm sending request e.g.
https://localhost:8888/status
NO RESPONSE appears.
Does anyone know where might be the problem?
For defiantly it is server fault. My apigility instances are working perfectly normal on production server with SSL. Could you give some more information.
Can you open your apiglity admin panel by browser? Is it working?
Is there any error in response headers or some other clue? Are you sending "Accept" header?
What is your apigility and zf2 versions?

Resources