 loadCacheSwfFile = (req, res, callback) ->
   # These two swf files are source code files, not resource files
   # Caching these files may cause illegal logic error I guess?
-  if req.url.indexOf('/kcs/Core.swf') != -1
-    callback {err: true}
-    return
-  if req.url.indexOf('/kcs/mainD2.swf') != -1
-    callback {err: true}
+  if (req.url.indexOf('/kcs/Core.swf') != -1) || (req.url.indexOf('/kcs/mainD2.swf') != -1)
+    callback true
     return
 
   if req.url.indexOf('/kcs/') != -1
     # Get FilePath
-    filePath = ''
-    beginIndex = req.url.indexOf('/kcs/') + 1
-    endIndex = req.url.indexOf('?')
-    if endIndex != -1
-      filePath = req.url.substr beginIndex, (endIndex - beginIndex)
-    else
-      filePath = req.url.substr beginIndex
+    filePath = url.parse(req.url).pathname.substr 1
 
     # Get FileSize
     fs.stat filePath, (err, stat) ->

              res.writeHead result.statusCode, result.headers
              res.write data
              res.end()

serverWithSocksProxy = (req, res) ->
  console.log "Get Request #{req.url} using Socks Proxy"

              res.writeHead result.statusCode, result.headers
              res.write data
              res.end()
              saveCacheSwfFile req, data

serverWithoutProxy = (req, res) ->
  console.log "Get Request #{req.url}"
