Encode/decode request from load balancer server to the worker client

This commit is contained in:
Bilal
2020-05-08 06:32:04 +02:00
parent a77b46aad6
commit 7e12d2819e
2 changed files with 7 additions and 2 deletions

View File

@@ -61,7 +61,9 @@ func handleConnection(conn net.Conn) {
for {
request := <-workerDescription.Req
_, err := conn.Write([]byte("URL " + request.Url + "\n"))
requestBase64 := b64.StdEncoding.EncodeToString([]byte("URL " + request.Url))
_, err := conn.Write([]byte(requestBase64 + "\n"))
if err != nil {
log.Println("Cannot send to " + clientAddr)
conn.Close()