This article discusses account migrations and how they can affect email client applications, such as older versions of Microsoft Outlook and Apple.
Account migrations involve transferring user accounts from one email service or platform to another. This process can be necessary for various reasons, including upgrading to a new email provider, consolidating accounts, or transitioning to a cloud-based service.
Legacy email clients, such as older versions of Microsoft Outlook and Apple Mail, may face challenges during account migrations:
To minimize issues during account migrations, consider the following best practices:
During migrations, users may encounter various challenges. Here are some common issues and their solutions:
Migrations can significantly impact legacy email client applications. By following best practices and being aware of potential challenges, users can ensure a smoother transition to a new email service.
If you have a question or issue concerning PostgreSQL development at ViniHost, you're in the right place. This collection of articles covers topics such as accessing PostgreSQL from the command line, importing and exporting databases, accessing databases programmatically, and much more.
To connect to a PostgreSQL database from the command line, use the following command:
psql -U username -d database_name
Replace username with your PostgreSQL username and database_name with the name of the database you want to access.
You can import and export databases using the following commands:
pg_dump database_name > backup_file.sql
psql -U username -d database_name < backup_file.sql
To access PostgreSQL databases programmatically, you can use various libraries depending on your programming language:
psycopg2
library.JDBC
driver.pg
module.To ensure efficient and secure PostgreSQL development, consider the following best practices:
During PostgreSQL development, users may encounter various challenges. Here are some common issues and their solutions:
EXPLAIN
command to analyze slow queries and optimize them.Understanding PostgreSQL development is crucial for effective database management. By following best practices and being aware of common challenges, developers can enhance their PostgreSQL experience.
ViniHost uses the Apache web server, and customizing its configuration for your web site may involve modifying .htaccess files or setting up modules. These articles discuss some common (and not so common) scenarios you may encounter, such as how to resolve a "403 Forbidden" error message and how to utilize Server-Side Includes (SSI) when setting up your web site on an Apache web server.
The .htaccess file allows you to customize the configuration of your Apache web server on a per-directory basis. Here are some common directives:
Redirect
directive to redirect users from one URL to another.ErrorDocument
directive.Require all granted
or Require all denied
.A "403 Forbidden" error indicates that the server understands the request, but refuses to authorize it. Common causes include:
Require
directives that may be blocking access.Server-Side Includes (SSI) allow you to include content from other files into your web pages. To enable SSI:
mod_include
module is enabled in your Apache configuration.Options +Includes
<!--#include file="header.html" -->
Apache supports a variety of modules that can enhance your web server's functionality:
To ensure optimal performance and security, consider the following best practices:
Customizing the Apache web server is essential for optimizing your website's performance and security. By understanding common configurations and issues, you can effectively manage your web environment.
Get answers to your PHP development questions here, or solutions to an issue you might be encountering. Learn about custom php.ini files, running PHP scripts from cron jobs, and more.
The php.ini file is crucial for configuring PHP settings. You can create custom php.ini files for specific directories. Here’s how:
upload_max_filesize
or memory_limit
.You can automate PHP scripts by running them as cron jobs. Here's a simple guide:
crontab -e
to edit your cron jobs.* * * * * /usr/bin/php /path/to/your/script.php
Familiarize yourself with these essential PHP functions:
Effective error handling is crucial for debugging. Use these methods:
error_reporting(E_ALL);
To enhance your PHP development, consider these best practices:
Understanding PHP development is essential for building dynamic web applications. By leveraging custom configurations and best practices, you can enhance your PHP skills and troubleshoot issues effectively.
If you're a Pythonista, this is the place for you. This collection of articles covers topics such as running Python scripts, configuring virtualenv and pip, installing Django, and much more.
To run a Python script, follow these simple steps:
cd /path/to/directory
.python script_name.py
python3 script_name.py
Using virtual environments helps manage dependencies for different projects. Here’s how to set it up:
pip install virtualenv
virtualenv myenv
source myenv/bin/activate
(Linux/Mac) or myenv\Scripts\activate
(Windows).
pip install package_name
Django is a popular web framework for building web applications. To install it:
pip install django
python -m django --version
Here are some essential libraries you might find useful:
To enhance your Python coding practices, consider the following:
unittest
module to write tests for your code.Mastering Python opens up a world of possibilities in programming and web development. By leveraging these tools and best practices, you can enhance your skills and streamline your development process.
Look here for everything you need to know about running Perl scripts on ViniHost's servers. We have articles covering Perl script basics and how to troubleshoot Perl scripts.
To execute a Perl script, follow these steps:
cd /path/to/directory
.perl script_name.pl
Understanding the fundamentals of Perl scripting is essential. Here are some key concepts:
Ksh
for scalar variables, @
for arrays, and %
for hashes.if
, for
, and while
for flow control.sub
keyword.If you encounter issues with your Perl scripts, consider these troubleshooting tips:
perl -c script_name.pl
to check for syntax errors.use warnings;
at the beginning of your script.print
statements to output variable values and track script execution.Enhance your Perl scripts with these commonly used modules:
To improve your Perl coding practices, consider the following:
use strict;
to enforce good coding habits.Mastering Perl scripting can greatly enhance your development capabilities. By understanding the basics and following best practices, you can effectively troubleshoot and optimize your Perl scripts.
If you're working with Ruby applications, this is the place for you. This collection of articles covers how to install gems, use the Interactive Ruby Shell, and more.
Gems are packages of Ruby code that extend the functionality of your applications. To install a gem, follow these steps:
gem install gem_name
gem list
The Interactive Ruby Shell (IRB) allows you to execute Ruby code in real-time. Here’s how to use it:
irb
puts 'Hello, Ruby!'
exit
To create and run a simple Ruby script, follow these steps:
.rb
extension, e.g., hello.rb
.puts 'Hello, World!'
ruby hello.rb
Here are some essential libraries you might find useful:
To enhance your Ruby coding practices, consider the following:
Working with Ruby can greatly enhance your development capabilities. By mastering the basics and following best practices, you can create robust applications and streamline your development process.
ViniHost servers run the Linux operating system, and that means knowing about shebangs, inode counts, and more. This collection of articles provides the information you need.
A shebang is the first line in a script that indicates which interpreter should be used to run the script. Here’s how to use it:
#!/usr/bin/env bash
(for Bash scripts) or #!/usr/bin/env python3
(for Python scripts).
chmod +x script_name
./script_name
Inodes store metadata about files and directories. To check inode counts, use:
df -i /path/to/directory
df -i
Familiarize yourself with these essential Linux commands:
Understanding file permissions is crucial in Linux. Here’s a quick guide:
r
(read), w
(write), and x
(execute).ls -l
chmod 755 file_name
(sets read, write, and execute for owner and read and execute for group and others).
Manage software packages using the following commands:
sudo apt update
(update package list)sudo apt install package_name
(install a package)
sudo yum update
(update package list)sudo yum install package_name
(install a package)
Understanding Linux fundamentals is essential for effectively managing ViniHost servers. By mastering these concepts and commands, you'll be well-equipped to navigate and utilize the Linux environment.
This collection of articles covers how to use version control systems, like Git and Subversion, on ViniHost servers.
Version control systems (VCS) help you manage changes to files over time. They are essential for collaboration and maintaining a history of your work.
Git is a distributed version control system widely used for software development. Here’s how to get started:
sudo apt install git
(for Debian/Ubuntu) or sudo yum install git
(for Red Hat/CentOS).
git init
(in your project directory).
git clone repository_url
.
Here are some essential Git commands:
git status
to see changes.git add file_name
.git commit -m "Commit message"
.
git push origin branch_name
.
Subversion is another popular version control system. Here’s how to use it:
sudo apt install subversion
(for Debian/Ubuntu) or sudo yum install subversion
(for Red Hat/CentOS).
svn checkout repository_url
.
svn add file_name
.
svn commit -m "Commit message"
.
To make the most of version control systems, consider these best practices:
Mastering version control systems like Git and Subversion is crucial for efficient collaboration and project management. By following the guidelines and commands outlined here, you'll be well-equipped to manage your projects effectively.
Flash, MP3, MIDI, JavaScript plugins... This collection of articles covers some client-side technologies commonly encountered in web-based environments.
Client-side technologies are essential for creating interactive and dynamic web applications. They run in the user's browser and enhance the user experience.
JavaScript is a versatile programming language that enables dynamic content on web pages. Here are some essential features:
HTML5 introduced new elements for multimedia, making it easier to embed audio and video:
<audio>
tag to embed sound files:<audio controls><source src="audio.mp3" type="audio/mpeg"></audio>
.
<video>
tag for videos:<video controls><source src="video.mp4" type="video/mp4"></video>
.
Plugins enhance the functionality of web applications. Common examples include:
While Flash was once popular for animations and interactive content, it has been largely phased out due to security issues and lack of support in modern browsers. Alternatives include:
Understanding client-side technologies is crucial for developing engaging and interactive web applications. By leveraging JavaScript, HTML5, and various plugins, developers can create rich user experiences that enhance the functionality of their websites.
This collection of articles discusses application deployment solutions that you can use in your own development projects, including Docker and LAMP stacks.
Application deployment involves making an application available for use. This can include various strategies and technologies to ensure reliability, scalability, and performance.
Docker is a platform that allows developers to automate the deployment of applications inside lightweight containers. Key benefits include:
To get started with Docker, follow these steps:
sudo apt install docker.io
(for Debian/Ubuntu) or follow the official installation guide for other systems.
Dockerfile
:FROM node:14
WORKDIR /app
COPY . .
RUN npm install
CMD ["npm", "start"]
.
docker build -t my-app .
.
docker run -p 3000:3000 my-app
.
The LAMP stack is a popular framework for building dynamic web applications. It consists of:
To set up a LAMP stack, follow these steps:
sudo apt install apache2
.
sudo apt install mysql-server
.
sudo apt install php libapache2-mod-php php-mysql
.
sudo systemctl restart apache2
.
To ensure successful application deployment, consider these best practices:
Understanding application deployment strategies like Docker and LAMP stacks is essential for modern development. By leveraging these tools, you can create scalable, reliable applications that meet user needs effectively.
You can help protect your web site from bots and spammers by adding CAPTCHA protection. Learn more about what CAPTCHAs are, when to use them, and various implementations, such as PHP and Python, here.
CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart." It is a challenge-response test used to determine whether the user is human or a bot.
Implement CAPTCHA in the following scenarios:
There are various types of CAPTCHA, including:
To add CAPTCHA protection to a PHP form, follow these steps:
<script src="https://www.google.com/recaptcha/api.js"></script>
<div class="g-recaptcha" data-sitekey="your_site_key"></div>
Ksh response = Ksh _POST['g-recaptcha-response'];
Ksh secretKey = "your_secret_key";
Ksh responseKeys = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={Ksh secretKey}&response={Ksh response}");
Ksh responseKeys = json_decode(Ksh responseKeys, true);
if(intval(Ksh responseKeys["success"]) !== 1) {
echo "Please complete the CAPTCHA.";
} else {
echo "CAPTCHA verified successfully!";
}
For a Python web application, you can use Flask with reCAPTCHA:
pip install Flask Flask-WTF
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from flask_wtf.recaptcha import RecaptchaField
class MyForm(FlaskForm):
recaptcha = RecaptchaField()
name = StringField('Name')
submit = SubmitField('Submit')
form = MyForm()
if form.validate_on_submit():
return "CAPTCHA verified successfully!"
return render_template('form.html', form=form)
Adding CAPTCHA protection to your website is an effective way to reduce spam and automated submissions. By implementing CAPTCHA with PHP or Python, you can enhance your site's security and ensure that your users are human.
The robots.txt file enables you to control which sections of your site are indexed by search engines and web crawlers. Learn about robots.txt directives and how to use them here.
The robots.txt file is a simple text file placed in the root directory of your website. It instructs web crawlers and search engine bots on how to crawl and index your site.
Using robots.txt helps you:
Here are some common directives you can use in your robots.txt file:
To create a robots.txt file:
robots.txt
.https://www.yourwebsite.com/robots.txt
).
User-agent: *
Disallow: /private/
Allow: /public/
Sitemap: https://www.yourwebsite.com/sitemap.xml
Here’s a sample robots.txt file:
User-agent: *
Disallow: /admin/
Disallow: /login/
Allow: /
Sitemap: https://www.yourwebsite.com/sitemap.xml
After creating your robots.txt file, you can test it using tools like:
Consider these best practices when using robots.txt:
Using a robots.txt file effectively allows you to manage how search engines and web crawlers interact with your site. By understanding and applying the correct directives, you can optimize your site's indexing and protect sensitive content.
Learn what URL frame forwarding is, which enables you to load external content on your site while maintaining your domain name in the browser address bar, and how to set it up in this article.
URL frame forwarding, also known as URL masking, allows you to display content from another website within a frame on your own site. This means that visitors will see your domain name in the address bar, even though they are viewing content from an external source.
There are several reasons to use URL frame forwarding:
Setting up URL frame forwarding typically involves the following steps:
For instance, if you want to display content from https://www.example.com
on your domain https://www.yourdomain.com
, you would set it up as follows:
Destination URL: https://www.example.com
Forwarding Type: Frame Forwarding
While URL frame forwarding has its benefits, there are some considerations to keep in mind:
URL frame forwarding can be a useful tool for maintaining your brand's presence while integrating external content. However, it's essential to weigh the pros and cons to ensure it aligns with your website's goals and user experience.
If you need a lightweight database solution without the overhead of MySQL or PostgreSQL, SQLite is the perfect choice. Learn more about how to use SQLite in these articles.
SQLite is a self-contained, serverless, zero-configuration, and transactional SQL database engine. It is widely used in applications where simplicity and speed are crucial.
SQLite is ideal for:
To get started with SQLite, follow these steps:
sqlite3
to start the SQLite command-line interface.Here are some basic commands to get you started with SQLite:
-- Create a new database
sqlite3 mydatabase.db
-- Create a new table
CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT);
-- Insert data into the table
INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com');
-- Query data from the table
SELECT * FROM users;
Explore these resources to deepen your understanding of SQLite:
SQLite is a powerful and efficient database solution that can meet the needs of various applications. Its simplicity and ease of use make it an excellent choice for developers looking for a reliable database without the complexity of traditional database management systems.
Lua is a programming language with powerful scripting capabilities. Some types of ViniHost accounts already have Lua installed, while for other account types you can install and configure it yourself. Learn more in this article.
Lua is a lightweight, high-level, multi-paradigm programming language designed primarily for embedded use in applications. It is known for its simplicity and flexibility, making it a popular choice for game development and web applications.
Lua is ideal for:
To get started with Lua, follow these steps:
lua
to start the Lua interpreter.Here are some basic commands to get you started with Lua:
-- Print "Hello, World!"
print("Hello, World!")
-- Create a table
myTable = {key1 = "value1", key2 = "value2"}
-- Access a table value
print(myTable.key1)
-- Define a function
function add(a, b)
return a + b
end
-- Call the function
print(add(5, 3))
Explore these resources to deepen your understanding of Lua:
Lua is a versatile and efficient programming language that offers a range of features suitable for various applications. Its ease of use and performance make it an excellent choice for developers looking to integrate scripting capabilities into their projects.
Learn how to determine if your cPanel or Plesk-based hosting account is on a server that uses CageFS.
CageFS is a virtualized file system and a set of tools that helps improve security on shared hosting environments. It isolates each user in their own environment, preventing them from seeing or accessing other users' files.
Using CageFS enhances security by:
Follow these steps to determine if your hosting account is using CageFS:
cat /proc/user_beancounters
You can also check for CageFS using PHP. Create a file named phpinfo.php
with the following content:
<?php
phpinfo();
?>
Access this file through your browser and look for "CageFS" in the output. If it appears, your account is using CageFS.
Determining if your account uses CageFS is crucial for understanding your hosting environment's security. Following the above methods will help you confirm whether CageFS is enabled on your server.
Virtual machines enable you to quickly and easily test website configurations in a controlled environment on your local computer. This article shows you how to install VirtualBox, create a virtual machine using VirtualBox, and install an operating system on the virtual machine.
A virtual machine (VM) is a software emulation of a physical computer that runs an operating system and applications just like a physical machine. VMs allow you to run multiple operating systems on a single host machine.
Follow these steps to install VirtualBox:
To create a virtual machine in VirtualBox, follow these steps:
To install an operating system on your newly created VM:
Configuring a virtual machine for local testing is a straightforward process that provides a safe and flexible environment for testing website configurations. With VirtualBox, you can easily install and manage multiple operating systems, making it a valuable tool for developers and testers.
This collection of articles covers various testing and development techniques that you can use while working on your own projects.
Web testing involves evaluating the functionality, performance, and security of web applications. It ensures that your web projects are reliable and user-friendly.
In addition to testing, employing effective development techniques is crucial for building robust web applications. Here are some best practices:
Here are some resources to help you deepen your understanding of web testing and development:
Web testing and development are essential components of creating high-quality web applications. By applying the techniques and practices outlined in this collection, you can enhance your projects and deliver a better user experience.
Node.js applications may be periodically terminated on shared and reseller servers. This article discusses how to keep your Node.js application up and running using either the preferred method of the Node.js selector in cPanel, or cron jobs.
In shared hosting environments, Node.js applications can be automatically terminated due to resource management policies. Keeping these applications persistent is essential for ensuring uninterrupted service.
If you prefer using cron jobs to keep your application running, follow these steps:
cd /home/username/path_to_your_app && node app.js
Making your Node.js applications persistent is crucial for maintaining uptime and reliability. By utilizing the Node.js selector in cPanel or setting up cron jobs, you can ensure that your applications remain active and responsive, even in shared hosting environments.
Learn how to enable Cross-Origin Resource Sharing (CORS) for your Linux or Windows hosting account.
Cross-Origin Resource Sharing (CORS) is a security feature implemented by web browsers that allows or restricts resources requested from a different domain than the one that served the original web page. It is essential for enabling web applications to interact with resources from different origins securely.
To enable CORS on a Linux hosting account, you can modify the `.htaccess` file in the root directory of your application:
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
For Windows hosting, you can enable CORS in the `web.config` file:
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Enabling CORS is crucial for allowing secure interactions between your web applications and external resources. By following the steps outlined for both Linux and Windows hosting, you can effectively manage resource sharing across different domains.
Nginx (pronounced "engine X") is a fast, efficient web server. This collection of articles covers how to install and configure the Nginx web server.
Nginx is an open-source web server that also acts as a reverse proxy, load balancer, and HTTP cache. Known for its high performance, stability, and low resource consumption, Nginx is widely used for serving static content and handling concurrent connections efficiently.
To install Nginx on a Linux server, follow these steps:
sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
Configuration files for Nginx are typically located in the /etc/nginx/
directory. The primary configuration file is nginx.conf
. Here are some common configurations:
/etc/nginx/sites-available/
and link it to /etc/nginx/sites-enabled/
:
sudo nano /etc/nginx/sites-available/example.com
server {
listen 80;
server_name example.com www.example.com;
location / {
root /var/www/example.com;
index index.html index.htm;
}
}
sudo nginx -t
sudo systemctl reload nginx
For more in-depth information about Nginx, consider exploring the following resources:
Nginx is a powerful web server that can handle a variety of tasks efficiently. Whether you're serving static content or acting as a reverse proxy, understanding how to install and configure Nginx will greatly enhance your web hosting capabilities.
You can install the AWS CLI (Amazon Web Services Command Line Interface), which enables you to work quickly and easily with your AWS account from your ViniHost account. This article covers how to install and use AWS CLI.
The AWS Command Line Interface (CLI) is a unified tool that allows you to manage your AWS services from the command line. With the AWS CLI, you can control multiple AWS services and automate them through scripts.
Follow these steps to install the AWS CLI on your system:
# For Windows, run the installer.
# For macOS, use Homebrew:
brew install awscli
# For Linux, use the following command:
sudo apt-get install awscli
aws --version
After installation, configure the AWS CLI with your AWS credentials:
aws configure
Once configured, you can start using the AWS CLI to manage your AWS services. Here are some common commands:
aws s3 ls
aws ec2 run-instances --image-id ami-12345678 --count 1 --instance-type t2.micro --key-name MyKeyPair
aws iam list-users
For more information on AWS CLI, check out the following resources:
The AWS Command Line Interface is a powerful tool that simplifies the management of AWS services. By following the steps outlined above, you can easily install and configure the AWS CLI to enhance your productivity when working with AWS.
A hosts file is a file that maps domain names to IP addresses. This article explains how to edit the hosts file on a Mac.
The hosts file is a plain text file used by the operating system to map hostnames to IP addresses. It acts as a local DNS system, allowing you to override DNS settings for specific domain names.
Applications > Utilities > Terminal
.sudo nano /etc/hosts
You will be prompted to enter your administrator password.
IP_address hostname
For example:
127.0.0.1 example.com
CTRL + O
, then hit Enter
. To exit, press CTRL + X
.sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
sudo cp /etc/hosts /etc/hosts.backup
For more information on the hosts file and its usage, consider the following resources:
Editing the hosts file on a Mac is a straightforward process that can be useful for various tasks, such as testing and blocking websites. By following the steps outlined above, you can easily manage your hosts file to suit your needs.
By default, shared and reseller servers automatically generate a robots.txt file if it is missing. This article describes how to disable this behavior.
The robots.txt
file is a standard used by websites to communicate with web crawlers and spiders. It tells these agents which parts of the site should not be accessed or indexed. By default, many hosting providers automatically create this file if it doesn't exist.
robots.txt
file that suits your specific needs.After disabling the automatic creation, verify that no robots.txt
file is generated:
robots.txt
file is not present. If it is, you may need to delete it manually.robots.txt
file may expose your site to unwanted indexing.For more information on robots.txt
and its usage, consider the following resources:
Disabling the automatic creation of the robots.txt
file allows for greater control over how search engines interact with your website. By following the steps outlined above, you can effectively manage this setting to meet your specific needs.
This article demonstrates how to use an SSL certificate in a Node.js app. By using an SSL certificate in your app, you can support secure (HTTPS) connections.
SSL (Secure Sockets Layer) is a protocol for establishing a secure connection between a client and a server. It encrypts data transmitted over the internet, ensuring that sensitive information remains private.
https
module (which is built-in) and any other required packages:
npm install express
const express = require('express');
const https = require('https');
const fs = require('fs');
const app = express();
// Load SSL certificate and key
const options = {
key: fs.readFileSync('path/to/your/private.key'),
cert: fs.readFileSync('path/to/your/certificate.crt')
};
// Create HTTPS server
https.createServer(options, app).listen(443, () => {
console.log('Secure server running on port 443');
});
// Example route
app.get('/', (req, res) => {
res.send('Hello, secure world!');
});
const http = require('http');
http.createServer((req, res) => {
res.writeHead(301, { "Location": "https://" + req.headers['host'] + req.url });
res.end();
}).listen(80);
https://yourdomain.com
to ensure everything is working correctly.For more information on SSL and Node.js, consider the following resources:
Using an SSL certificate in your Node.js app is essential for securing user data and enhancing trust. By following the steps outlined above, you can easily set up HTTPS for your application.
This article describes how to configure and use WebSocket connections on a VPS or Dedicated server. Please note that WebSocket connections are not supported on shared or reseller hosting accounts at this time.
WebSockets are a protocol for full-duplex communication channels over a single TCP connection, enabling real-time data transfer between the client and server. They are ideal for applications requiring instant updates, such as chat applications, live notifications, and online gaming.
sudo apt update
sudo apt install nodejs npm
ws
library can be installed via npm:
npm install ws
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 8080 });
wss.on('connection', (ws) => {
console.log('Client connected');
ws.on('message', (message) => {
console.log(`Received: Ksh {message}`);
// Echo the message back to the client
ws.send(`You said: Ksh {message}`);
});
ws.on('close', () => {
console.log('Client disconnected');
});
});
console.log('WebSocket server is running on ws://localhost:8080');
const socket = new WebSocket('ws://localhost:8080');
socket.onopen = () => {
console.log('Connected to the server');
socket.send('Hello Server!');
};
socket.onmessage = (event) => {
console.log(`Message from server: Ksh {event.data}`);
};
socket.onclose = () => {
console.log('Disconnected from the server');
};
For more information on WebSockets and their usage, consider the following resources:
Configuring and using WebSocket connections on a VPS or Dedicated server allows for real-time communication in your applications. By following the steps outlined above, you can effectively set up and utilize WebSockets in your projects.
Please click here for Support Chat.