 import WebKit
 import UIKit
 
+extension String {
+  func base64Encoded() -> String? {
+    if let data = self.data(using: .utf8) {
+      return data.base64EncodedString()
+    }
+    return nil
+  }
+  
+  func base64Decoded() -> String? {
+    if let data = Data(base64Encoded: self) {
+      return String(data: data, encoding: .utf8)
+    }
+    return nil
+  }
+}
+
 class ViewController: UIViewController, WKNavigationDelegate {
   var webView: WKWebView?
   var clientSocket:Socket?
   var buffer_in = ""
+  var hasOrange = false
   let startPage = "<html>\n" +
                   "<head>\n" +
                   "<style>\n" +

  
  override func viewDidLoad() {
    super.viewDidLoad()
    self.edgesForExtendedLayout = []
    let queue = DispatchQueue(label: "org.webpagetest.socketlisten", attributes: .concurrent)
    queue.async {

        }
      } catch let err {
        self.log("\(id): Socket Read error: \(err)")
        cont = socket.isConnected
      }
    } while cont
    socket.close()
