Socket45
Introduction
Socket45 is a web browser plug-in "container".
It implements a large portion of the Netscape
plug-in interface, and is capable of running most browser plug-ins.
It is a Win32 program, and requires Windows 95 or higher
(98, NT, 2000, ME, whatever).
Where to get it
Download this link:
socket45-111.zip
(about 60K).
This is version 1.1.1 -- 6 Sep 2001
The C source code is now included in the distribution.
It is free to use and distribute.
Please read the license in the file
socket45.txt.
Some previous versions are still available:
socket45-110.zip
socket45-105.zip/socket45-105-src.zip
Warning |
USE THIS PROGRAM AT YOUR OWN RISK! In order to be useful,
Socket45 must execute a plug-in that was
written by a third party. This makes it impossible for the author(s)
of Socket45 to fully control what may happen when it is used.
Since Socket45 does not perfectly emulate a web browser's environment,
plug-ins are more likely to malfunction than they are in a web browser.
While it is extremely unlikely that anything more serious than a crash
will occur, the user of Socket45 must assume full responsibility for
that possibility.
|
Warning |
Be sure to read the license agreement of any plug-in that you
use with Socket45.
Some of them forbid their use in a program that is not
a web browser (and Socket45 probably qualifies as "not a web browser").
|
How to install it
Make a directory and extract the file socket45.exe into it.
History
Changes in version 1.1.1 (6 Sep 2001)
- Fixed a serious problem in passing parameters to the plug-in. Not sure
how that ever worked.
- Slightly improved parameter parser.
- Source code no longer requires Netscape plug-in SDK.
Changes in version 1.1.0 (24 Jun 2001)
My thanks to Paul Chitescu for most of the improvements in
this version.
- Improved stream handling -- now asynchronous, using timers.
- New "Break Stream" function.
- Plug-in is restarted if it tries to re-read the same URL.
- Several miscellaneous modifications to improve compatibility with
existing plug-ins.
- The license has been changed to remove the requirement
of an acknowledgment if you use this software in your product.
But it'd be pretty rude of you to not give credit where it's
due.
Changes in version 1.0.5 (13 Jan 1999)
- Hidden plug-ins: You can now hide plug-ins by checking the "Hidden" setting in
the setup dialog. At least, I think it works pretty much like hidden plug-ins
are supposed to. To use it with Netscape's npaudio.dll plug-in,
put "autostart=true" in the Parameters section.
- New option to not display a notice when a plug-in requests to download a URL.
(Some plug-ins request a URL automatically every time they start.)
Uncheck "Show URL requests" in the Setup dialog.
- Moved some menu items to the "Actions|Tests" submenu.
- Clearly displays the streaming method that the plug-in uses, in the event log.
It can be either NORMAL, ASFILE, ASFILEONLY, or SEEK (though SEEK shouldn't
happen).
- Print behaves as a version 0.9 browser if you set the API version to 0.9 or less.
- Status bar now defaults to On for new file types.
Changes in version 1.0.4
There are no functional changes in this version. It was made to keep it in
sync with the newly-released source code.
Changes in version 1.0.3
- New feature: Support for windowless plug-ins (mostly untested).
- Less flicker.
- The usual minor fixes.
Changes in version 1.0.2
- Changed name to "Socket45".
- New feature: Can now Print plug-ins that support printing.
- New feature: Replace window, to test if plug-ins can handle having their
window swapped out from under them.
- Log displays plug-in API version.
- Some other minor fixes.
Changes in version 1.0.1
Current status
Most plug-ins that are simply document viewers will work fine.
I'd list some plug-ins that are known to work, but
it's just too much trouble to maintain such a list.
Network-related and JavaScript-related functions are not implemented.
A plug-in that needs to write streams, or read additional streams, or
requires LiveConnect, will probably not work. Some plug-ins will work,
but with reduced functionality.
Other reasons that a plug-in might not work is that it could very sensitive
to quirks in the behavior of the well-known browsers, or that it misbehaves
and works outside the plug-in interface (for example, it might search for
a running program called "Netscape" and try to communicate with it directly).
If a plug-in works with Netscape but not with Internet Explorer, it may
not work with Socket45.
If you find an ordinary, freely-available, plug-in that fails to
work in Socket45 for no obvious reason,
feel free to let me know about it. I can't
promise anything, but I might be able to find an easy way to make it
work. (Note, I'm not talking about massive, complex plug-ins like
Java or RealAudio here....)
What's the point of this, anyway?
So why not just use a browser? Well, in most cases you should just use your
browser. Better yet, find a standalone viewer and don't use the plug-in at all.
I never said this was a particularly useful program!
But here are some possible uses:
- To run plug-ins on computers that may not have an appropriate browser installed.
- As a file viewer, when all you have is a plug-in. Some advantages over using a browser:
- You don't have to install it into your browser.
- Loads faster
- Better use of screen real-estate
- Greater control over the plug-in. You can make it embedded and assign
default parameters to be used to initialize the plug-in.
- You have full control over what plug-in is used to view a particular
file type.
- You can test different plug-ins that view the same type of file very
quickly and easily, with no uninstalling, restarting, refreshing, renaming, etc.
- To help developers write plug-ins:
- It allows much greater control over manipulating plug-ins.
- You can test your plug-in in many different "environments" quickly and
easily. No need to write test web pages.
- As mentioned before, it loads much faster than a browser.
This is nice for debugging, where you may have to load your
browser each time you run your plug-in in debug mode.
- The event log may help find potential problems, including some memory
leaks.
- It can give you some information about how other people's plug-ins behave
while they are running. Can be a useful learning tool.
- Just to play with, 'cause it's so darn k3wl!
User's Guide
EXPRESS CONFIGURATION OF SOCKET45 |
Locate the plug-in you want to use (the file that starts with
NP and ends with .DLL), and drag-and-drop it into Socket45. Then locate the
data file you want to view and drag-and-drop it into Socket45. You will
be asked if you want to use the current plug-in to view that file. Click Yes.
The plug-in will now run (hopefully). From the menu, choose File|Save settings by
file type. From now on, you can drag-and-drop (or File|Open) data files
with the same extension into Socket45, and that plug-in will automatically
be loaded and used.
|
DETAILED INSTRUCTIONS
To run a plug-in, Socket45 needs at least 2 pieces of information: The file to
view, and the plug-in to use to view it. Press F7 (or File|Setup)
to bring up
a dialog box that will let you choose this, along with many other bits of
information that are usually optional.
- Data file: enter the name of the file you want to view.
- Plug-in: locate the plug-in to use to view the file. A plug-in in this
sense is the plug-in's main file; it will always start with "NP" and end
with ".DLL". [Note: By default, Windows hides DLL files from view. You will have
to change that if you want to use Socket45. But if you're the type of person
who would use a program like this, you've probably already done that.]
You can enter a plug-in that is in another browser's plug-in directory, or you
can install the plug-in to some custom directory and use it from there. Most
plug-ins consist of only that single file and can be moved/copied at will, but
some (such as Cosmo Player) require other files.
- MIME type: Enter the MIME type for the data file that is to be sent
to the plug-in. The MIME type will look something like "image/gif" or
"video/mpeg". The drop-down list will show what MIME types the current plug-in
claims to support. You can choose from the list, or type in a different one.
MIME types are normally used by the browser to determine what plug-in
to use, and not by the plug-in, so it is usually safe to leave this blank.
A few plug-ins may require it, however.
- URL: This tells the plug-in the web address of the datafile that it
is viewing. If you set it to "Auto" (recommended), a pseudo-URL starting with
"file://" will be constructed automatically. A few plug-ins may behave differently
depending on what URL they think they are viewing, so Socket45 lets you lie and
tell the plug-in whatever you want.
- UserAgent: This is supposed to tell the plug-in what browser you are
using, to allow it to work around the various quirks of the various browsers.
If you set it to Auto (recommended) it will use something like "Socket45/1.1.0",
but to pretend you are using Netscape you could set it to something like
"Mozilla/5.0 [en] (Win98; I)", or for Internet Explorer:
"Microsoft Internet Explorer".
- Mode: Socket45 supports "Full page" and "Embedded" plug-ins,
simulating a web browser. If you choose Embedded, you will be able to set
window dimensions and
plug-in parameters. A thin border will be displayed around Embedded plug-ins.
There is no other difference between these modes, except that the
plug-in knows which mode it is in and can choose to adjust its behavior
accordingly. Many plug-ins behave differently when Embedded.
- Hidden: Embedded plug-ins can be made "hidden" which means
they will not be given a window to display themselves in. Some audio
plug-ins can work if they are hidden. Most others can't.
- Width and Height: In Embedded mode, you can either set a fixed
height and width for the plug-in, or you can set "Auto size" and it will be
set to the size of the main Socket45 window (this simulates "width=100% height=100%"
in the EMBED tag). If you set a height or width that is larger than the Socket45
window, Socket45 will display scoll bars as needed.
- Parameters: This is where you can enter anything that would normally go
in the EMBED tag in your web page. For example, with the Shockwave Flash plug-in you
could enter "salign=TL quality=high" to align the image at the top left and use
high quality drawing. The parameters are entirely specific to the plug-in. You
generally do not need to enter standard parameters that are used by the browser,
such as HEIGHT, WIDTH, and SRC. !!! PLEASE NOTE !!!: The current version of Socket45
uses a very limited parser for these parameters. You may not use spaces around the
'=' sign or quotation marks around the value. There is currently no way to embed
spaces in a value. This will be fixed in a later version, probably.
- Version and FuncTblSize: These are some numbers that get
sent to the plug-in, that it may use to determine the capabilities of the
browser. Most plug-ins ignore them.
You should not increase them beyond the default values (0, 11, 60, 88),
but it may be necessary to decrease some of them to get a few plug-ins to work.
Try (0, 9, 52, 60).
If you set the API Version to 0.9 or less, Socket45 will adjust its
Print function to mimic an 0.9 browser.
- OK: Press OK to close the Setup dialog box and keep all your changes.
Nothing will be applied until you at least start a new instance of the plug-in.
To be sure all of the new settings are applied, press F6, then F5.
- Cancel: Close the Setup dialog box and lose all your changes (unless
you pressed Apply first).
- Apply: Unloads the current plug-in (if any) and loads the one specified
in the Setup dialog (with all the new settings), without closing the Setup dialog.
Use this to test many different plug-ins or combinations of settings. As usual,
after you Apply the settings, you can't use Cancel to undo them.
- Start: Closes the dialog box and applies all the changes, immediately
running the new plug-in with the new settings. This is usually the most useful of
these buttons.
Menu commands
- File | Open: Opens a data file and executes a plug-in to view it.
If Socket45 does not know what plug-in to use, the Setup dialog box will be
opened so that the user can select a plug-in.
- File | Load: Same as Open, but only loads the Setup information
and does not execute the plug-in. Useful if the currently saved Setup
information causes the program to, uh, crash or something.
- File | Save settings by file type: Save all of the settings based on
the extension of the current file. They will be reloaded automatically whenever
you open a datafile with the same extension. This is a very important
feature! It is how you associate plug-ins with datafiles.
- File | Save settings by file: Save all of the settings based on
the current filename. If you have files with the same extension that require
different settings, you can use this to save different settings for each.
Only the base filename is used, not location of the file.
Don't use this unless you have to.
- File | Erase settings for this file: Erase the file-specific
settings for the current file. The extension-specific settings (if any)
will be used when this file is opened in the future.
Note: There is no option to erase settings by file type. This is
intentional -- it wouldn't be very useful.
- File | Print: Prints the plug-in. Not all plug-ins support
printing, but most do.
- Actions | Start:
Performs whatever actions are necessary to run the plug-in
and send the data file to it. (If a plug-in is loaded, but not running, it
does not shut it down and reload it, even if a different plug-in has since been
selected in Setup. Press Stop, then Start, if you want to do that.)
If the plug-in is already running, the current instance of it will be destroyed
and restarted.
- Actions | Stop: Shuts down the plug-in and unloads it completely.
-
Actions | Initialize plug-in
Actions | New instance
Actions | Write stream
Actions | Destroy instance
Actions | Shutdown plug-in
The functions on the Actions menu let you run and shut
down the plug-in step by step. If you don't know what they mean, it is safe
to just ignore these functions.
-
Actions | Break stream:
Stop sending the current stream to the plug-in.
- Actions | Tests | Replace window: Destroys the current plug-in window
and immediately creates a new one. Plug-ins are supposed to be able to
handle this, though I've never seen a browser actually do this. Some
plug-ins handle it fine and just keep on running. Most don't.
This function is useful only to plug-in developers.
- Actions | Tests | Write new stream: Sends a new data file to a
running plug-in
without restarting it. Under normal circumstances this would never happen
unless the plug-in specifically requested the new data, so it is not surprising
that this does not work with most plug-ins. [But that's no excuse!]
Try it with Shockwave Flash 3.0 if you want evidence that it really does work
sometimes.
- View | Status bar: Some plug-ins display messages on the status
bar. It is turned on by default, but it is rarely very useful, so you may want
to turn it off for most file types to gain a few extra pixels of screen
real-estate.
The state of the status bar will be saved when you save settings
for a file or file type.
- View | Event log: (For experts only) If you want to see what's
really happening. [Note: Status bar changes will be logged here
if, and only if, the status bar is turned off.]
Notes
- You can have Windows associate certain file types with Socket45, and
it will be launched whenever you double-click on that type of file.
Right click on a file and choose "Open with...". (If "Open with" is not on
the menu, hold down Shift when you right-click. However,
changing the association of a registered file extension might change the
association for other file extensions as well.) Choose "socket45" from the menu,
or find it with the "Other..." button if it is not there yet.
- Socket45 supports drag-and-drop; to open a datafile, just drag it from
Explorer and drop it into Socket45.
- If the plug-in tries to open up a web page, you will get a message
informing you of this. If the URL appears to be an "absolute URL" (that is,
if it includes the web site), Socket45 will allow you to try to open that
web page in your default web browser.
Feedback
You may send comments, suggestions, and constructive criticism via email to
Jason Summers at
jason1@pobox.com.
[Back to my home page]