Index: trunk/BNC/bnccaster.cpp
===================================================================
--- trunk/BNC/bnccaster.cpp	(revision 87)
+++ trunk/BNC/bnccaster.cpp	(revision 88)
@@ -69,5 +69,5 @@
 // New Observations
 ////////////////////////////////////////////////////////////////////////////
-void bncCaster::slotNewObs(const QByteArray& mountPoint, Observation* obs) {
+void bncCaster::slotNewObs(const QByteArray& staID, Observation* obs) {
 
   long newTime = obs->GPSWeek * 7*24*3600 + obs->GPSWeeks;
@@ -88,5 +88,5 @@
   // Rename the station and save the observation
   // -------------------------------------------
-  strncpy(obs->StatID, mountPoint.constData(),sizeof(obs->StatID));
+  strncpy(obs->StatID, staID.constData(),sizeof(obs->StatID));
   _epochs->insert(newTime, obs);
 
@@ -113,14 +113,14 @@
           this, SLOT(slotGetThreadError(const QByteArray&)));
 
-  _mountPoints.push_back(getThread->mountPoint());
+  _staIDs.push_back(getThread->staID());
 }
 
 // Error in get thread
 ////////////////////////////////////////////////////////////////////////////
-void bncCaster::slotGetThreadError(const QByteArray& mountPoint) {
-  _mountPoints.removeAll(mountPoint);
+void bncCaster::slotGetThreadError(const QByteArray& staID) {
+  _staIDs.removeAll(staID);
   emit( newMessage(
-           QString("Mountpoint size %1").arg(_mountPoints.size()).toAscii()) );
-  if (_mountPoints.size() == 0) {
+           QString("Mountpoint size %1").arg(_staIDs.size()).toAscii()) );
+  if (_staIDs.size() == 0) {
     emit(newMessage("bncCaster:: last get thread terminated"));
     emit getThreadErrors();
Index: trunk/BNC/bnccaster.h
===================================================================
--- trunk/BNC/bnccaster.h	(revision 87)
+++ trunk/BNC/bnccaster.h	(revision 88)
@@ -20,5 +20,5 @@
    ~bncCaster();
    void addGetThread(bncGetThread* getThread);
-   int  nMountPoints() const {return _mountPoints.size();}
+   int  numStations() const {return _staIDs.size();}
 
  signals:
@@ -27,9 +27,9 @@
 
  public slots:
-   void slotNewObs(const QByteArray& mountPoint, Observation* obs);
+   void slotNewObs(const QByteArray& staID, Observation* obs);
 
  private slots:
    void slotNewConnection();
-   void slotGetThreadError(const QByteArray& mountPoint);
+   void slotGetThreadError(const QByteArray& staID);
 
  protected:
@@ -46,5 +46,5 @@
    QTcpServer*                    _server;
    QList<QTcpSocket*>*            _sockets;
-   QList<QByteArray>              _mountPoints;
+   QList<QByteArray>              _staIDs;
    QMap<QString, bncRinex*>       _rinexWriters;
 };
Index: trunk/BNC/bncgetthread.cpp
===================================================================
--- trunk/BNC/bncgetthread.cpp	(revision 87)
+++ trunk/BNC/bncgetthread.cpp	(revision 88)
@@ -32,17 +32,7 @@
 // Constructor
 ////////////////////////////////////////////////////////////////////////////
-bncGetThread::bncGetThread(const QString& host, int port,
-                           const QString& proxyHost, int proxyPort,
-                           const QByteArray& mountPoint,
-                           const QByteArray& user, 
-                           const QByteArray& password,
-                           const QByteArray& format) {
-  _host       = host;
-  _port       = port;
-  _proxyHost  = proxyHost;
-  _proxyPort  = proxyPort;
+bncGetThread::bncGetThread(const QUrl& mountPoint, const QByteArray& format) {
   _mountPoint = mountPoint;
-  _user       = user;
-  _password   = password;
+  _staID      = mountPoint.path().toAscii();
   _format     = format;
   _socket     = 0;
@@ -57,31 +47,19 @@
 // Connect to Caster, send the Request (static)
 ////////////////////////////////////////////////////////////////////////////
-QTcpSocket* bncGetThread::request(const QString& host, int port,
-                                  const QString& proxyHost, int proxyPort,
-                                  const QByteArray& mountPoint,
-                                  const QByteArray& user, 
-                                  const QByteArray& password,
-                                  QString& msg) {
+QTcpSocket* bncGetThread::request(const QUrl& mountPoint, QString& msg) {
 
-  msg.clear();
-
+  // Connect the Socket
+  // ------------------
+  QSettings settings;
+  QString proxyHost = settings.value("proxyHost").toString();
+  int     proxyPort = settings.value("proxyPort").toInt();
+ 
   QTcpSocket* socket = new QTcpSocket();
-
-  QByteArray l_mountPoint = mountPoint;
-
   if ( proxyHost.isEmpty() ) {
-    socket->connectToHost(host, port);
+    socket->connectToHost(mountPoint.host(), mountPoint.port());
   }
   else {
     socket->connectToHost(proxyHost, proxyPort);
-    if (!proxyHost.isEmpty()) {
-      QUrl proxyUrl;
-      proxyUrl.setScheme("http");
-      proxyUrl.setHost(host);
-      proxyUrl.setPort(port);
-      l_mountPoint = proxyUrl.resolved(QUrl(mountPoint)).toEncoded();
-    }
   }
-
   if (!socket->waitForConnected(timeOut)) {
     msg += "Connect timeout\n";
@@ -92,9 +70,11 @@
   // Send Request
   // ------------
-  QByteArray userAndPwd = user + ":" + password;
-  QByteArray reqStr = "GET " + l_mountPoint + " HTTP/1.0\r\n"
-                      "User-Agent: NTRIP BNC 1.0\r\n"
-                      "Authorization: Basic " + userAndPwd.toBase64() + 
-                      "\r\n\r\n";
+  QByteArray userAndPwd = mountPoint.userName().toAscii() + ":" + 
+                          mountPoint.password().toAscii();
+  QByteArray  reqStr = "GET " + mountPoint.path().toAscii() + 
+                       " HTTP/1.0\r\n"
+                       "User-Agent: NTRIP BNC 1.0\r\n"
+                       "Authorization: Basic " +
+                       userAndPwd.toBase64() + "\r\n\r\n";
 
   msg += reqStr;
@@ -118,6 +98,7 @@
   // ----------------
   QString msg;
-  _socket = bncGetThread::request(_host, _port, _proxyHost, _proxyPort, 
-                                  _mountPoint, _user, _password, msg);
+
+  _socket = bncGetThread::request(_mountPoint, msg);
+
   emit(newMessage(msg.toAscii()));
 
@@ -146,17 +127,17 @@
 
   if      (_format.indexOf("RTCM_2") != -1) {
-    emit(newMessage("Get Data: " + _mountPoint + " in RTCM 2.x format"));
+    emit(newMessage("Get Data: " + _staID + " in RTCM 2.x format"));
     decoder = new RTCM('A',true);
   }
   else if (_format.indexOf("RTCM_3") != -1) {
-    emit(newMessage("Get Data: " + _mountPoint + " in RTCM 3.0 format"));
+    emit(newMessage("Get Data: " + _staID + " in RTCM 3.0 format"));
     decoder = new rtcm3();
   }
   else if (_format.indexOf("RTIGS") != -1) {
-    emit(newMessage("Get Data: " + _mountPoint + " in RTIGS format"));
+    emit(newMessage("Get Data: " + _staID + " in RTIGS format"));
     decoder = new rtigs();
   }
   else {
-    emit(newMessage(_mountPoint + " Unknown data format " + _format));
+    emit(newMessage(_staID + " Unknown data format " + _format));
     return exit(1);
   }
@@ -174,5 +155,5 @@
       for (list<Observation*>::iterator it = decoder->m_lObsList.begin(); 
            it != decoder->m_lObsList.end(); it++) {
-        emit newObs(_mountPoint, *it);
+        emit newObs(_staID, *it);
       }
       decoder->m_lObsList.clear();
@@ -190,5 +171,5 @@
 void bncGetThread::exit(int exitCode) {
   if (exitCode!= 0) {
-    emit error(_mountPoint);
+    emit error(_staID);
   }
   QThread::exit(exitCode);
Index: trunk/BNC/bncgetthread.h
===================================================================
--- trunk/BNC/bncgetthread.h	(revision 87)
+++ trunk/BNC/bncgetthread.h	(revision 88)
@@ -12,22 +12,15 @@
 
  public:
-   bncGetThread(const QString& host, int port,
-                const QString& proxyHost, int proxyPort,
-                const QByteArray& mountPoint,
-                const QByteArray& user, 
-                const QByteArray& password,
-                const QByteArray& format);
+   bncGetThread(const QUrl& mountPoint, const QByteArray& format);
    ~bncGetThread();
-   static QTcpSocket* bncGetThread::request(const QString& host, int port,
-                                      const QString& proxyHost, int proxyPort,
-                                      const QByteArray& mountPoint,
-                                      const QByteArray& user, 
-                                      const QByteArray& password,
-                                      QString& msg);
-   QByteArray mountPoint() {return _mountPoint;}
+
+   static QTcpSocket* bncGetThread::request(const QUrl& mountPoint,
+                                            QString& msg);
+
+   QByteArray staID() const {return _staID;}
 
  signals:
-   void newObs(const QByteArray& mountPoint, Observation* obs);
-   void error(const QByteArray& mountPoint);
+   void newObs(const QByteArray& staID, Observation* obs);
+   void error(const QByteArray& staID);
    void newMessage(const QByteArray& msg);
 
@@ -38,11 +31,6 @@
    void exit(int exitCode = 0);
    QTcpSocket* _socket;
-   QString     _host;
-   int         _port;
-   QString     _proxyHost;
-   int         _proxyPort;
-   QByteArray  _mountPoint;
-   QByteArray  _user;
-   QByteArray  _password;
+   QUrl        _mountPoint;
+   QByteArray  _staID;
    QByteArray  _format;
 };
Index: trunk/BNC/bncmain.cpp
===================================================================
--- trunk/BNC/bncmain.cpp	(revision 87)
+++ trunk/BNC/bncmain.cpp	(revision 88)
@@ -46,9 +46,4 @@
   else {
     QSettings settings;
-    QString    proxyHost = settings.value("proxyHost").toString();
-    int        proxyPort = settings.value("proxyPort").toInt();
-    QByteArray user      = settings.value("user").toString().toAscii();
-    QByteArray password  = settings.value("password").toString().toAscii();
-    
     bncCaster* caster = new bncCaster(settings.value("outFile").toString(),
                                       settings.value("outPort").toInt());
@@ -65,11 +60,6 @@
       if (hlp.size() <= 1) continue;
       QUrl url(hlp[0]);
-      QByteArray mountPoint = url.path().mid(1).toAscii();
-      QByteArray format     = hlp[1].toAscii();
-
-      bncGetThread* getThread = new bncGetThread(url.host(), url.port(),
-                                                 proxyHost, proxyPort, 
-                                                 mountPoint, user, password,
-                                                 format);
+      QByteArray format = hlp[1].toAscii();
+      bncGetThread* getThread = new bncGetThread(url, format);
       app.connect(getThread, SIGNAL(newMessage(const QByteArray&)), 
                   &app, SLOT(slotMessage(const QByteArray&)));
@@ -79,5 +69,5 @@
       getThread->start();
     }
-    if (caster->nMountPoints() == 0) {
+    if (caster->numStations() == 0) {
       return 0;
     }
Index: trunk/BNC/bnctabledlg.cpp
===================================================================
--- trunk/BNC/bnctabledlg.cpp	(revision 87)
+++ trunk/BNC/bnctabledlg.cpp	(revision 88)
@@ -31,15 +31,30 @@
   QVBoxLayout* mainLayout = new QVBoxLayout(this);
 
-  _casterHostLabel    = new QLabel(tr("caster host"));
-  _casterPortLabel    = new QLabel(tr("caster port"));
+  _casterHostLabel     = new QLabel(tr("caster host"));
+  _casterPortLabel     = new QLabel(tr("caster port"));
+  _casterUserLabel     = new QLabel(tr("user"));
+  _casterPasswordLabel = new QLabel(tr("password"));
   QSettings settings;
-  _casterHostLineEdit = new QLineEdit(settings.value("casterHost").toString());
-  _casterPortLineEdit = new QLineEdit(settings.value("casterPort").toString());
-
-  QHBoxLayout* editLayout = new QHBoxLayout;
-  editLayout->addWidget(_casterHostLabel);
-  editLayout->addWidget(_casterHostLineEdit);
-  editLayout->addWidget(_casterPortLabel);
-  editLayout->addWidget(_casterPortLineEdit);
+  _casterHostLineEdit     = new QLineEdit(settings.value("casterHost").toString());
+  int ww = QFontMetrics(_casterHostLineEdit->font()).width('w');
+  _casterHostLineEdit->setMaximumWidth(18*ww);
+  _casterPortLineEdit     = new QLineEdit(settings.value("casterPort").toString());
+  _casterPortLineEdit->setMaximumWidth(9*ww);
+  _casterUserLineEdit     = new QLineEdit(settings.value("casterUser").toString());
+  _casterUserLineEdit->setMaximumWidth(9*ww);
+  _casterPasswordLineEdit = new QLineEdit(settings.value("casterPassword").toString());
+  _casterPasswordLineEdit->setMaximumWidth(9*ww);
+  _casterPasswordLineEdit->setEchoMode(QLineEdit::Password);
+
+  QGridLayout* editLayout = new QGridLayout;
+  editLayout->addWidget(_casterHostLabel, 0, 0);
+  editLayout->addWidget(_casterHostLineEdit, 0, 1);
+  editLayout->addWidget(_casterPortLabel, 0, 2);
+  editLayout->addWidget(_casterPortLineEdit, 0, 3);
+  editLayout->addWidget(_casterUserLabel, 1, 0);
+  editLayout->addWidget(_casterUserLineEdit, 1, 1);
+  editLayout->addWidget(_casterPasswordLabel, 1, 2);
+  editLayout->addWidget(_casterPasswordLineEdit, 1, 3);
+
   mainLayout->addLayout(editLayout);
 
@@ -81,16 +96,13 @@
 void bncTableDlg::slotGetTable() {
 
-  QString    host       = _casterHostLineEdit->text();
-  int        port       = _casterPortLineEdit->text().toInt();
-  QByteArray mountPoint = "/";
-  QByteArray user;
-  QByteArray password;
+  QUrl url;
+  url.setHost(_casterHostLineEdit->text());
+  url.setPort(_casterPortLineEdit->text().toInt());
 
   // Send the Request
   // ----------------
   QString msg;
-  QTcpSocket* socket = bncGetThread::request(host, port, _proxyHost, 
-                                             _proxyPort, mountPoint, 
-                                             user, password, msg);
+  QTcpSocket* socket = bncGetThread::request(url, msg);
+
   if (!socket) {
     QMessageBox::warning(0, "BNC", msg);
@@ -163,4 +175,6 @@
   settings.setValue("casterHost", _casterHostLineEdit->text());
   settings.setValue("casterPort", _casterPortLineEdit->text());
+  settings.setValue("casterUser", _casterUserLineEdit->text());
+  settings.setValue("casterPassword", _casterPasswordLineEdit->text());
 
   QStringList* mountPoints = new QStringList;
@@ -173,4 +187,6 @@
       if (_table->isItemSelected(item)) {
         QUrl url;
+        url.setUserName(_casterUserLineEdit->text());
+        url.setPassword(_casterPasswordLineEdit->text());
         url.setHost(_casterHostLineEdit->text());
         url.setPort(_casterPortLineEdit->text().toInt());
Index: trunk/BNC/bnctabledlg.h
===================================================================
--- trunk/BNC/bnctabledlg.h	(revision 87)
+++ trunk/BNC/bnctabledlg.h	(revision 88)
@@ -27,4 +27,8 @@
     QLineEdit*   _casterHostLineEdit;
     QLineEdit*   _casterPortLineEdit;
+    QLabel*      _casterUserLabel;
+    QLabel*      _casterPasswordLabel;
+    QLineEdit*   _casterUserLineEdit;
+    QLineEdit*   _casterPasswordLineEdit;
 
     QPushButton* _buttonGet;
Index: trunk/BNC/bncwindow.cpp
===================================================================
--- trunk/BNC/bncwindow.cpp	(revision 87)
+++ trunk/BNC/bncwindow.cpp	(revision 88)
@@ -76,6 +76,5 @@
   _canvas->setLayout(layout);
 
-  _userLabel          = new QLabel("user");
-  _passwordLabel      = new QLabel("password");
+  _timeOutLabel       = new QLabel("timeout (sec)");
   _proxyHostLabel     = new QLabel("proxy host");
   _proxyPortLabel     = new QLabel("proxy port");
@@ -95,9 +94,6 @@
   _proxyPortLineEdit  = new QLineEdit(settings.value("proxyPort").toString());
   _proxyPortLineEdit->setMaximumWidth(9*ww);
-  _userLineEdit       = new QLineEdit(settings.value("user").toString());
-  _userLineEdit->setMaximumWidth(9*ww);
-  _passwordLineEdit   = new QLineEdit(settings.value("password").toString());
-  _passwordLineEdit->setMaximumWidth(9*ww);
-  _passwordLineEdit->setEchoMode(QLineEdit::Password);
+  _timeOutLineEdit    = new QLineEdit(settings.value("timeOut").toString());
+  _timeOutLineEdit->setMaximumWidth(9*ww);
   _outFileLineEdit    = new QLineEdit(settings.value("outFile").toString());
   _outPortLineEdit    = new QLineEdit(settings.value("outPort").toString());
@@ -144,12 +140,10 @@
   _log->setReadOnly(true);
 
-  layout->addWidget(_userLabel,          0, 0);
-  layout->addWidget(_userLineEdit,       0, 1);
-  layout->addWidget(_passwordLabel,      0, 2);
-  layout->addWidget(_passwordLineEdit,   0, 3);
-  layout->addWidget(_proxyHostLabel,     1, 0);
-  layout->addWidget(_proxyHostLineEdit,  1, 1);
-  layout->addWidget(_proxyPortLabel,     1, 2);
-  layout->addWidget(_proxyPortLineEdit,  1, 3);
+  layout->addWidget(_proxyHostLabel,     0, 0);
+  layout->addWidget(_proxyHostLineEdit,  0, 1);
+  layout->addWidget(_proxyPortLabel,     0, 2);
+  layout->addWidget(_proxyPortLineEdit,  0, 3);
+  layout->addWidget(_timeOutLabel,       1, 1);
+  layout->addWidget(_timeOutLineEdit,    1, 2);
   layout->addWidget(_outFileLabel,       2, 1);
   layout->addWidget(_outFileLineEdit,    2, 2, 1, 2);
@@ -234,6 +228,5 @@
   settings.setValue("proxyHost",   _proxyHostLineEdit->text());
   settings.setValue("proxyPort",   _proxyPortLineEdit->text());
-  settings.setValue("user",        _userLineEdit->text());
-  settings.setValue("password",    _passwordLineEdit->text());
+  settings.setValue("timeOut",     _timeOutLineEdit->text());
   settings.setValue("outFile",     _outFileLineEdit->text());
   settings.setValue("outPort",     _outPortLineEdit->text());
@@ -264,9 +257,4 @@
   _actGetData->setEnabled(false);
 
-  QString    proxyHost = _proxyHostLineEdit->text();
-  int        proxyPort = _proxyPortLineEdit->text().toInt();
-  QByteArray user      = _userLineEdit->text().toAscii();
-  QByteArray password  = _passwordLineEdit->text().toAscii();
-
   _bncCaster = new bncCaster(_outFileLineEdit->text(), 
                              _outPortLineEdit->text().toInt());
@@ -282,11 +270,7 @@
   for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
     QUrl url(_mountPointsTable->item(iRow, 0)->text());
-    QByteArray mountPoint = url.path().mid(1).toAscii();
     QByteArray format     = _mountPointsTable->item(iRow, 1)->text().toAscii();
 
-    bncGetThread* getThread = new bncGetThread(url.host(), url.port(),
-                                               proxyHost, proxyPort, 
-                                               mountPoint, user, password,
-                                               format);
+    bncGetThread* getThread = new bncGetThread(url, format);
 
     connect(getThread, SIGNAL(newMessage(const QByteArray&)), 
Index: trunk/BNC/bncwindow.h
===================================================================
--- trunk/BNC/bncwindow.h	(revision 87)
+++ trunk/BNC/bncwindow.h	(revision 88)
@@ -43,6 +43,5 @@
     QLabel*    _proxyHostLabel;
     QLabel*    _proxyPortLabel;
-    QLabel*    _userLabel;
-    QLabel*    _passwordLabel;
+    QLabel*    _timeOutLabel;
     QLabel*    _rnxPathLabel;
     QLabel*    _rnxSkelLabel;
@@ -55,6 +54,5 @@
     QLineEdit* _proxyHostLineEdit;
     QLineEdit* _proxyPortLineEdit;
-    QLineEdit* _userLineEdit;
-    QLineEdit* _passwordLineEdit;
+    QLineEdit* _timeOutLineEdit;
     QLineEdit* _outFileLineEdit;
     QLineEdit* _outPortLineEdit;
