LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-24-2013, 08:33 AM   #1
prushik
Member
 
Registered: Mar 2009
Location: Pennsylvania
Distribution: gentoo
Posts: 372

Rep: Reputation: 29
New command line tool: HTTP server optimized for p2p file transfers


Hello everyone.
I would like to announce a new command line tool I have developed for Linux. It is a simple HTTP server which has been optimized for decentralized point to point file transfer use.
A typical use case would be to send a large file by email, the sender can run the server on his/her computer and email a link to the file where the receiver can download the link with any web browser or with wget. There are a number of added features to facilitate this usage.

The entire program is written in C.

More information and source code can be located here:
http://betteros.org/sw/http.php


Enjoy, and tell me what you think.
 
Old 11-24-2013, 05:24 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,748

Rep: Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927
I would default to die after one transfer and a port other then 80.
I would display usage if no command line arguments were used.
The show_addr function does not display the correct IP address.
Improvements might be to add a compression option if transferring large or multiple files.
 
Old 11-24-2013, 09:26 PM   #3
prushik
Member
 
Registered: Mar 2009
Location: Pennsylvania
Distribution: gentoo
Posts: 372

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by michaelk View Post
I would default to die after one transfer and a port other then 80.
I would display usage if no command line arguments were used.
The show_addr function does not display the correct IP address.
Improvements might be to add a compression option if transferring large or multiple files.
Thank you for your feedback.
You may be right, it could make sense to die after one transfer by default, I will think about that. However, I can not think about another default port other than 80. I imagine very very few people will actually find it useful to run it on port 80 and it will fail if the user has something like Apache already running, but I cannot think of another sensible default (other than just picking on arbitrarily).
Displaying usage by default is probably a good idea. I will change that.
The show_addr function should work, and it worked in my testing, however, of course it only shows the LAN IP (if behind a NAT). It also shows the address of "eth0" by default, in order to display some other interface you have to specify it with -i <if> on the command line.

Built-in compression or encryption would be useful I agree, but there are already good Linux tools for this and I would prefer not to add any external dependencies.

Thanks!
 
Old 11-25-2013, 06:42 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,748

Rep: Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927Reputation: 5927
Port 8080 is probably one of the next most used. Using a port >1024 means non root users can run the program too.
 
Old 11-25-2013, 08:09 AM   #5
prushik
Member
 
Registered: Mar 2009
Location: Pennsylvania
Distribution: gentoo
Posts: 372

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by michaelk View Post
Port 8080 is probably one of the next most used. Using a port >1024 means non root users can run the program too.
I suppose, it does make sense since that port is official designated as the HTTP alternative by IANA. Or I could just force the user to choose one explicitly, which defaulting to port 80 sort of does anyway since unless users are willing to run it as root. Something I have to think about though... choosing good defaults is hard....
 
Old 11-25-2013, 08:29 AM   #6
prushik
Member
 
Registered: Mar 2009
Location: Pennsylvania
Distribution: gentoo
Posts: 372

Original Poster
Rep: Reputation: 29
Ok, I made a few changes and uploaded a new version.
It now dies after one connection by default. I added a new command line argument (-c) to emulate the old behavior.
It now displays the usage page if run with no arguments.
The usage page now displays information about what the defaults are. Hopefully this can help people understand the default behavior and understand how to change it to suit their purposes easier.
I did not change the default port, but I may in the future.
 
  


Reply

Tags
decentralized, http, p2p, server



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to get the file in my http server server through wget command ramesh14 Linux - Software 1 06-24-2011 07:30 AM
Connect to SSH Server thru Autheticated Windows HTTP Proxy from Command-line cslibby Linux - Networking 3 06-07-2008 09:33 AM
LXer: Advanced P2P using command line tools LXer Syndicated Linux News 0 04-03-2007 01:31 PM
Resuming FTP transfers on command-line Mankind75 Linux - Software 7 04-23-2004 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration