How to change path of socket.io in socket.io.slim.js - html

I am using socket.io for multiuser experience in one of our metaverse projects. We have deployed the code in a https server and after deploying the multiuser experience collapsed. When check for errors, we have found the following error.
enter image description here
enter image description here
we need to change the path of Url for where it needs to look for socket.io.
Can someone suggest any ideas for changing this path?

This usually means one of 2 things:
the socket.io server is not running
the socket.io server is running on a different place
Make sure socket.io is using the HTTPS server, not the HTTP one, and the client is connecting to the correct domain.

Related

i would like to know few things about how to host and upload full website include(server ,react, mysql)

Finally i completed my first full project using server, client, data
i would like to know few things about how to host and upload full website include(server ,react, mysql)
i so wondering how that is work, for now i understand that to upload a simple website you need a domain and to hosting, just do npm run build and upload it..., this is something that i know but, when that is not just a simple website like
when i have such as
server side with Node.js + express that have requests (on localhost) *probably need to change the localhost to something else but what
Database running with MySql
React app that have many request to (localhost)
how can i hosting all of them and running my website for everyone, i mean that my sql will still running, CRUD Data will update normal, and the server will still get request and send or update them to mysql data.
and if I'll want to make some change on mysql, server, client
i want to change it like i change it now
Actually i'm not a FullStack developer if i don’t know it... 🥶 so i really interesting to understand all of that issues
i hope you guys havק An understandable answer for me, thanks 🙏 and just take your time :)
Well, where to start hehe. There are a lot of different ways to host a web app. Heroku for example makes this process really simple.
Personally, I use Digital Ocean to host my apps. This is generally how that goes:
I have a project with a folder structure that seperates the server logic and the client logic.
Since you're using Node, you build your client with npm run build. Next make sure the dist/build folder is inside your server folder. That is the folder you are going to 'host'. On Digital Ocean, you make a new droplet (which basically is just a tiny part of a server).
You install Node, Git, Pm2 and (for example) Nginx. You clone your project from Github to the server and install all the dependencies.
You have to do a few configurations with nginx (specifying a domain name for example) to make everything work. This article goes into more detail about that.
Also, a database is frequently hosted seperately. You should read more about that.
If you have everything setup, you can just code on your project as usual. Push new updates to github, and pull in the changes on the server.
Here is another post on Stackoverflow talking about hosting MySql with react.

how to navigate to a url from our local host?

I have a url eg: xyz.net/645636. I'm trying to access it but it is giving me an error saying cannot get to xyz.net/645636. But, I didn't have any problem navigating to that page directly.
The local host url is http://localhost:3000/index.html.
I'm running my application using node server setup on my local system.
Example Link
The link doesn't have any protocols. Could some one point out where am I doing it wrong?
It needs a protocol:
Example Link
When you type the address into your browser without one, it adds it for you for convenience.

Can I use html5 Websockets with windows domain authentication?

Our setup is like this: we use a coldfusion 10 server, and files are on a local intranet. Users use a domain login to access any files over https. I'm interested in using html5 websockets, but the first attempt gave me an error because no credentials were supplied. Is there a way around this? If not, is there a recommended technology for this scenario?
The user does log in on the client side. If it's possible, what I'd really like to do here is pass those credentials when making the connection to the server.
you should be able to supply the authentication header to your web socket server before the elevation to web socket read that and send it back in the headers for the elevation (first frame) then when the browser connects it should have the authentication it needs.
if your using a custom authentication E.G in page not authentication header you can also do this by passing any custom header to your server.
Or mandate that the first thing your web client sends is the authentication details this could be something like {username_hash}.{password_hash} if they don't close the socket to them.
Do not do this.
You're now responsible for sending and encrypting the authentication credentials yourself, bypassing something that already works and is tested.
Anyone can snoop on an unencrypted websocket port. Use HTTPs for an intranet, use stable solutions, don't reinvent this wheel because it tickles your fancy.
In a couple of years some colleague will have to maintain this and will have to figure out how your homebrew version works versus something that's solid like plain browser authentication.
My advice: Leave this to the browser and to well-tested coldfusion libraries.

HTML5 php websocket

I'm new to HTML 5, websocket. We are trying application like white board.Users who all are logged in that particular session can type their thoughts in white board div. It should display to all users who are logged in that session. So i tried to use Php Websocket. what all are the steps need to follow to run php Websocket on server side. Let me know further clarification.
Thanks,
Dhinesh.B
Find some PHP classes that implement the latest Websocket protocol RFC6455. This is an example implementation that I tested and that is working just fine: https://github.com/esromneb/phpwebsocket . Copy those files to your websocket subfolder (e.g. /websocket)
The steps are:
Run the server side PHP (e.g. php -q websocket.demo.php). Use a previously unused socket port.
Connect to the server using a client HTML with Javascript websocket code. In your Javascript code use the port that you specified for the server (e.g. localhost/websocket/client.html)

Web server for Objective-C

How can I create a webserver from my Obj-C app, and post custom HTML to it?
Thanks!
Check:
SimpleHTTPServer
CocoaHTTPServer
To embed a lightweight HTTP server in iOS or Mac apps, check out GCDWebServer which has a modern and clean architecture designed on top of Grand Central Dispatch.
It would most likely be easier and far more secure to use something like FastCGI and then use an existing HTTP server such as Nginx to serve the HTML that your app passes along rather than trying to embed an HTTP server directly in your application. Plus Nginx is extremely fast and can handle huge server traffic without really breaking a sweat which not all other HTTP servers can say.
Plus using an embedded server means that your app and your HTTP server must run under the same UID which is bad from a security perspective as anyone compromising the HTTP server gains access to all your website files as well.