Read HTTP Request From TCP Socket Stream In Java (TCP Socket Programming)

preview_player
Показать описание
Here you will find out how Web servers process incoming requests from the browser.
It will be a plus if you have basic understanding of the HTTP protocol.
In this video we are creating a ServerSocket that is listening on a specific port.
When a new connection is received, we pass it to a new thread which then reads the content of the stream and parses it into our beloved HTTP format.
Initially the server is written in a way that is as straightforward as possible until we reach an issue while sending large HTTP requests.

Link to MDN about HTTP Structure:

Link to Github Repo:

Timecodes:
0:00 - Intro
2:07 - What is HTTP
4:51 - Project Skeleton
5:56 - Create Server On Port 8080
9:46 - Spawn a Thread for each connection
11:38 - Incorrectly read TCP Stream
16:49 - Parse HTTP Request
23:17 - Serving Files
33:10 - Uploading Files
39:00 - The Issue with TCP Streams
43:06 - Properly read TCP Stream
52:48 - Test
54:51 - Outro
56:03 - Custom Web Server
Рекомендации по теме
Комментарии
Автор

I leared this topic in a book and now i got your video 😅😅 literally books are amazing thanks for this practical implementation

mahajveemahajvee
Автор

I'm so happy you decided to make a video about that specific topic. Been searching for so long now.

ЦветомирДжоков
Автор

Thanks very much, your video solve my problem!

xuankunzheng
visit shbcf.ru