Using the 'AddURL' function in MyHttpServer To Load A Whole Folder Onto A Localhost

It seems that when I add use addurl with a folderitem, it only takes the index file. What is the best aprouch to load ALL of the files with this class? Should I just loop through the folders and/or files (depending on what will work) and call the AddURL function every time a file/folder goes through the loop.

Thanks

You should ask the author of the class.

Okay. Thanks

How can I get hold of Thom McGrathor or Brandon Skrtich? Thanks

Send a private message to Thom. He’s on the forums…

Thanks

Unless Brandon has changed anything in the latest version, AddURL will recurse into directories.

Here is part of my code:

  if f <> nil then
    if f.exists then
      if Socket = nil then
        Socket = new MyHTTPServerSocket
      end if
      Socket.AddURL("/", f)
      Socket.Port = 8080
      Socket.Listen
      //open game page in webbrowser
      ShowURL("http://127.0.0.1:8080/")
      'ShowURL("http://localhost")
    end if
  end if

It seems to load the index but it does not seem to load subdirectories. Applying the same folder and copying it into the WAMP server ‘www’ directory works fine. Is there anything that you see is wrong at a glance.

Thanks

I’m assuming “f” is a directory. Is that correct?

I’d suggest following along in the debugger to make sure what you expect to happen is actually happening. After the AddURL, the Socket.URLs property will contain all the mapped urls.

Do I have to create a ‘context’? Thanks