Net::NNTP::Proxy - a news server in perl
use Net::NNTP::Proxy; my $server = new Net::NNTP::Proxy || die "Couldn't start the server: $!\n"; $server->push(new Net::NNTP::Client); $server->listen(9119); my $client = $server->connect;
See below for more functions.
This package is a basic news server written in perl. It contains a list of Net::NNTP::Client connections, and talks to all of these to get its data; it then serves it back out to a port just like a regular news server. It's also clean enough to run multiple-processes (and maybe even multi-threaded, if I'm lucky.)
newsproxy.pl is used to actually run this thing.
These functions create the object and connect it to the network.
Create a new server object. Doesn't actually bind to the port; you still need to use listen() for that.
listen()
Listens on PORT for a TCP connection.
PORT
Stops listening for a TCP connection.
Connects to the given FILEHANDLE. Returns the filehandle again.
FILEHANDLE
Disconnects from FILEHANDLE, closing it in the process.
Process LINE, which was received from FILEHANDLE, and call the appropriate news function (which are all documented below). Returns
LINE
These functions return and manipulate the list of news servers that the object connects to and works with.
Returns a reference to an array containing the list of news servers that can be accessed.
Adds SERVER item onto the end of the list of news servers.
SERVER
Removes the first item from the list of the news servers.
These functions implement news functionality. Return values are designed to be written to a socket, which is taken care of by process(). None of this stuff is overly well documented; it follows the NNTP standards well where possible, however.
process()
Not yet implemented.
Retrieve and return the article indicated by ID. Looks through the list of news servers in order; the first server to have the article returns it.
ID
As article(), but just returns the body.
article()
Returns the current date from the server.
Changes to the given GROUP.
GROUP
As article(), but just returns the headers.
Not yet implemented
Stats the previous message, if there is one. See stat().
stat()
Lists off a certain value. Valid values are:
active ( PATTERN ) active.times newsgroups ( PATTERN ) overview.fmt (NOT YET IMPLEMENTED)
Loads up a given group, and gets a list of articles in it.
Sets the reader mode. At present, only 'reader' works.
Returns the overview information from the given RANGE.
RANGE
Close FILEHANDLE and quit.
News::Article, Net::NNTP
News::Article
Net::NNTP
This documentation is basically functional, but not much more.
Net::NNTP, Net::NNTP::Client, newsproxy.pl
Write better documentation. Write other news server types that aren't Net::NNTP::Client. Implement the rest of the functions that I haven't gotten around to yet. Speed it up.
Written by Tim Skirvin <tskirvin@killfile.org>.
Copyright 2000-2002 by Tim Skirvin <tskirvin@killfile.org>. This code may be redistributed under the same terms as Perl itself.
6 POD Errors
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
To install News::NNTPAuth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm News::NNTPAuth
CPAN shell
perl -MCPAN -e shell install News::NNTPAuth
For more information on module installation, please visit the detailed CPAN module installation guide.