forked from robbiehanson/CocoaHTTPServer
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves issue robbiehanson#56 - Use Xcode configuration files common…
… to all Sample projects. Also adding instructions to all sample projects.
- Loading branch information
1 parent
2c10c23
commit 56bd9ce
Showing
37 changed files
with
424 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Samples/DynamicServer/DynamicServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
INFO: | ||
|
||
This example project demonstrates the ability of the HTTPDynamicFileResponse to easily create dynamic content. | ||
|
||
Take a look at the Web/index.html file. You'll notice a bunch of "%%PLACEHOLDERS%%" meant to be replaced dynamically. With only a few lines of code, the HTTPDynamicFileResponse will replace these automatically, and asynchronously, as the file gets uploaded to the client! | ||
|
||
INSTRUCTIONS: | ||
|
||
Open the Xcode project, and build and go. | ||
|
||
On the Xcode console you'll see a message saying: | ||
"Started HTTP server on port 59123" | ||
|
||
Now open your browser and type in the URL: | ||
http://localhost:59123 | ||
|
||
(Replace 59123 with whatever port the server is actually running on.) | ||
|
||
Enjoy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
INFO: | ||
|
||
This project demonstrates password protecting a specific resource. More specifically, the project allows unrestricted access to the ~/Sites folder, but requires a password for anything in the ~/Sites/secret/ subfolder. | ||
|
||
INSTRUCTIONS: | ||
|
||
Create the following folder: | ||
~/Sites/secret | ||
|
||
And then add a file to it. For example: | ||
~/Sites/secret/doc.txt | ||
|
||
Open the Xcode project, and build and go. | ||
|
||
On the Xcode console you'll see a message saying: | ||
"Started HTTP server on port 59123" | ||
|
||
Now open your browser and type the URL: | ||
http://localhost:59123 | ||
|
||
Notice that it displays your file without password prompt: | ||
~/Sites/index.html | ||
|
||
Now type the URL: | ||
http://localhost:59123/secret/doc.txt | ||
|
||
Notice that it prompts you for a username/password. | ||
The sample code accepts any username, and the password is "secret". | ||
|
||
(Replace 59123 with whatever port the server is actually running on.) | ||
|
||
Enjoy. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
.../PasswdHTTPServer/PasswdHTTPServer.xcodeproj/project.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
INFO: | ||
|
||
This is an extremely simplified example of accepting a POST. | ||
|
||
The included Web folder is added to the project, copied into the applications resource bundle, and set as the document root of the http server. It only has a single index.html file which prompts you to answer a simple math question. Your answer is submitted as a post. | ||
|
||
The MyHTTPConnection class reads your response, and dynamically generates the response. | ||
|
||
INSTRUCTIONS: | ||
|
||
Open the Xcode project, and build and go. | ||
|
||
On the Xcode console you'll see a message saying: | ||
"Started HTTP server on port 59123" | ||
|
||
Now open your browser and type in the URL: | ||
http://localhost:59123 | ||
|
||
(Replace 59123 with whatever port the server is actually running on.) | ||
|
||
Enjoy. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.