You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -33,15 +33,15 @@ A web proxy is a program that acts as a middleman between a Web browser and an e
33
33
## How does proxy work?
34
34
35
35
It has the following detailed behavior:
36
-
- Set up the proxy to accept incoming connections:
36
+
-**Set up** the proxy to accept incoming connections:
37
37
1) Proxy creates a listening descriptor that is ready to receive connection requests on port ***`port`*** by calling ***`Open_listenfd()`*** funciton defined in **`socket.c`** file.
38
38
39
-
- Set up the proxy to deal with multiple concurrent connections using **prethreading** technique:
39
+
-**Set up** the proxy to deal with multiple concurrent connections using **prethreading** technique:
40
40
1) After initializing buffer ***`sbuf`*** declared in **`sbuf.h`** file, the main thread creates the set of worker threads by calling ***`Pthread_create()`*** defined in **`thread.c`** file.
41
41
2) Main thread then enters an infinite loop, waiting for connection requests using ***`Accept()`*** function defined in **`socket.c`** file.
42
42
3) It then inserts the resulting connected descriptors in ***`sbuf`***.
43
43
4) Each worker thread waits until it is able to remove a connected descriptor from the buffer and then calls the ***`serve_client()`*** function to serve the client.
44
-
- Run ***`serve_client()`*** routine:
44
+
-**Run*****`serve_client()`*** routine:
45
45
1) Read and parse the _HTTP_ request sent from the client by calling ***`read_HTTP_request()`*** function defined in **`serve.c`** file.
46
46
2) using ***`hash()`*** function defined in **`cache.c`** file, generate ***`HTTP_request_hash`*** that will be used to check if the cache contains the requested web object.
47
47
3) If the object is cached then read the object out of the cache rather than communicating again with the server by calling ***`service_from_cache()`*** function defined in **`service.c`** file.
0 commit comments