Https: Hyper Text Transfer Protocol Secure. could be a combination of the Hypertext Transfer Protocol with the SSL/TLS convention to supply encrypted communication and secure distinguishing proof of an arranged web server.
If the URL of that site is just HTTP, at that point anything you’re perusing or whatever points of interest you’re putting on that site, on the off chance that a programmer needs to take your data.
HTTPS is more secure than HTTP because HTTPS is certified by the SSL(Secure Socket Layer).
Secure Socket Layer: provides security to the data transferred between web browser and server. SSL encrypts the link between a web server and a browser which ensures that all data passed between them remain private and free from attack.
Secure Socket Layer Protocols:
- SSL record protocol
- Handshake protocol
- Change-cipher spec protocol
- Alert protocol
WebSocket: HTTP and WebSocket both are communication protocols used in client-server communication.
#HTTP headers varied from 200 bytes to 2 KB in size.
#the common size of the HTTP header is 700-800 bytes.
##When a web application uses more cookies and other tools on the client side that expand the storage features of the agent it reduces the HTTP header payload.
WebSocket is bidirectional, a full-duplex protocol that is used in the same scenario of client-server communication, unlike HTTP it starts from ws:// or wss://. It is a stateful protocol, which means the connection between client and server will keep alive until it is terminated by either party (client or server). After closing the connection by either of the client and server, the connection is terminated from both ends.
Let’s take an example of client-server communication, there is the client which is a web browser and a server, whenever we initiate the connection between client and server, the client-server made the handshaking and decide to create a new connection and this connection will keep alive until terminated by any of them. When the connection is established and alive the communication takes place using the same connection channel until it is terminated.
This is how after client-server handshaking, the client-server decides on a new connection to keep it alive, this new connection will be known as WebSocket. Once the communication link establishment and the connection are opened, message exchange will take place in bidirectional mode until the connection persists between client-server. If anyone of them (client-server) dies or decides to close the connection is closed by both of the party. The way in which the socket works is slightly different from how HTTP works, the status code 101 denotes the switching protocol in WebSocket.
###When can a web socket be used:
1. Real-time web application: Real-time web application uses a web socket to show
a. the data at the client end,,,,, continuously being sent by the backend server......
*****In WebSocket, data is continuously pushed/transmitted into the same connection which is already open, that is why WebSocket is faster and improves the application performance.
Example: 1. trading website 2. Bitcoin trading
displaying the price fluctuation and movement data is continuously pushed by the backend server to the client end.
2. Gaming application: data is continuously received by the server, and without refreshing the UI.
3. Chat application: Used only once for exchange, publishing, and broadcasting the message among the subscribers.
## It reuses the same WebSocket connection, for sending and receiving the message and for one-to-one message transfer.
When not to use WebSocket: WebSocket can be used if we want any real-time updated or continuous streams of data that are being transmitted over the network. If we want to fetch old data, or want to get the data only once to process it with an application we should go with HTTP protocol, old data which is not required very frequently or fetched only once can be queried by the simple HTTP request, so in this scenario, it’s better not use WebSocket.
Comments
Post a Comment