               res.writeHead result.statusCode, result.headers
               res.write data
               res.end()
+              saveCacheSwfFile req, data
 
 serverWithHttpProxy = (req, res) ->
   console.log "Get Request #{req.url} using HTTP Proxy"

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}
    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

    # Get FileSize
    fs.stat filePath, (err, stat) ->

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

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