Random Chat - Instant Chat with Strangers (2024)

Advertisem*nts

Free random chat room. Connect with strangers. No registration. Start chat with strangers instantly. This is a great one-on-one text chat alternative.

By starting random chat you agree to the Terms of Use and Privacy policy
You can also have a good time on chat rooms and talk to strangers.
We recommend you read our Safe Chatting Guide to ensure a secure and enjoyable experience.

    "); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); setTimeout(function() { $('#msgs .alert-error').remove(); }, 4000); } return false; // Stop further execution for this click event } // Check if there's an active session with a stranger if (stranger_session != false) { socket.emit("request_photo", stranger_session); $("#msgs").append("

  • " + my_name_li + ": Requested Photo
  • "); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); } else { // If not in a session, inform the user to start chatting with someone if (!$('#msgs').find('.alert-error').length) { $("#msgs").append("

    Start Chat With Someone to Request Photo

    "); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); setTimeout(function() { $('#msgs .alert-error').remove(); }, 4000); } } }); $('#random-chat').on('click', '.report_random', function() { if(stranger_id != false) { // Open the report form modal $('#report_form').show(); // Handle form submission $('#reportForm').on('submit', function(e) { e.preventDefault(); // Prevent default form submission var reportReason = $('#reportReason').val(); var additionalDetails = $('input[name="additionalDetails"]').val(); $.ajax({ type: "POST", timeout: 10000, cache: false, url: "/room/random_report", data: { 'stranger_session': stranger_session, 'stranger_id': stranger_id, 'report_reason': reportReason, 'additional_details': additionalDetails } }).done(function(data) { $('#report_form').hide(); // Close the modal $("#msgs").append("

    Report submitted successfully. We will review it within 24 hours and take any necessary actions.

    "); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); setTimeout(function() { $('#msgs .alert-error').remove(); }, 10000); // Remove the message after 10 seconds $('.report_random').prop('disabled', true); }); }); } else { $("#msgs").append("

    Start Chat With Someone First!

    "); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); setTimeout(function() { $('#msgs .alert-error').remove(); }, 4000); } }); function isPhoneNumber(text) { var pattern = /(\d[\D]{0,2}){6,}\d/g; var matches = text.match(pattern); if (matches) { // If any match is found, consider it as having a phone number pattern return true; } // No matches found resembling a phone number pattern return false; } function show_error(msg) {$("#msgs").append('

  • '+msg+'
  • ');setTimeout(function() {$("#msgs .alert-error").last().parent('li').remove();}, 5000);$("#chatbox").animate({ scrollTop: $('#msgs')[0].scrollHeight}, 0); }function emit_message() { msg = $("#msg").val(); if (msg == 'Type Here...') { $("#start_random button").click(); return false; } if (/\bhttps?:\/\/\S+\b/ig.test(msg)) {show_error("Links are not allowed here!"); $("#msg").val(''); return false; } if (isPhoneNumber(msg)) { show_error("Phone number is not allowed here!"); $("#msg").val(""); return false; } msg = $($.parseHTML(msg)).text(); msg = msg.replace(/[^\x20-\x7E]+/g, ''); if(msg.replace(/\s+/g, '').length > 0 && stranger_session != false) { socket.emit("send", {'msg': msg, 'id': stranger_session, 'count_key': key_speed, 'summ_mouse' : 0}); $("#msg").val(''); key_speed = 0; iLastTime = 0; iTime = 0; iTotal = 0; iKeys = 0; count_messages_session = count_messages_session + 1; $("#msgs").append("

  • "+my_name_li+": " + msg+ "
  • "); if($("#tiping").length) { $('#tiping').appendTo('#msgs'); } $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); }} $('#msg').bind('focus click', function () { textarea_focus = true; $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); }); $('#msg').bind('click', function () { socket.emit("typing", stranger_session); }); $('#msg').bind('paste', function(e){ return false; }); $("#send_message").click(function() { emit_message(); $("#msg").focus(); }); $("#msg").keypress(function(e){ if(e.which == 13) { emit_message(); if(e.preventDefault) { e.preventDefault(); } return false; } });var is_typing = '';socket.on("typing", function() { if(stranger_name==false) return; clearTimeout(is_typing); is_typing = setTimeout(function() { $("#tiping").remove(); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); return false; }, 5000); if($("#tiping").length) { return false; } $("#msgs").append("

  • "+ stranger_name +" is typing...
  • "); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight'));}); socket.on("kick", function(data) { kick = true; setCookie('kick',1, 1); leave_alert = false; socket.disconnect(); socket = null; document.location.href = "/"; }); socket.on("reload", function(data) { leave_alert = false; document.location.href = "/random-chat"; }); var correctCaptchaAgain = function(response) { if(response.length > 0) { var html_c = ''; html_c += ""; html_c += ""; $('#random-chat-center').html(html_c).show(); } }; var onloadCallback2 = function() { grecaptcha.render('html_element2', { 'sitekey' : '6LfBAWoaAAAAAPaeh9X0LCj1lPLotVMt0BTwZ7rQ', 'callback' : correctCaptchaAgain }); }; socket.on("disconnect", function(data) { var html_d = ''; if(ads_loadet) { html_d += '

  • '; } html_d += "

  • "; if(data==1) { html_d += ""+ stranger_name +" disconnected."; } if(is_captha== 1 && count_disconnects > 20) { html_d += "
    Just to make sure you are not a bot:
    "; html_d += ''; html_d += "
    "; html_d += ""; } else if(conversations > 0) { html_d += "

    "; html_d += "

    "; html_d += "
    By starting random chat, you confirm that you are over 18 years old and agree to the Terms of Use and Privacy policy
    "; }; html_d += "
  • "; $("#msgs").html(html_d); if(is_captha== 1 && count_disconnects > 20) { onloadCallback2(); count_disconnects = 0; localStorage.setItem('count_disconnects',count_disconnects); } $("#msg, #more, #send_message").attr("disabled", "disabled"); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); stranger_session = false; stranger_id = false; stranger_name = false; stranger_country = false; textarea_focus = false; clearTimeout(waiting_timeout); count_messages_session = 0; count_disconnects = count_disconnects + 1; localStorage.setItem('count_disconnects',count_disconnects); }); function encodeHTML(s) { return s.replace(/&/g, '&').replace(/ 0) { var file = filesSelected[0]; if (file.type.match('image.*')) { var reader = new FileReader(); reader.readAsDataURL(file); reader.onload = function (e) { var image = new Image(); image.onload = function (imageEvent) { // Resize the image using canvas var canvas = document.createElement('canvas'), max_size = 300, width = image.width, height = image.height; if (width > height) { if (width > max_size) { height *= max_size / width; width = max_size; } } else { if (height > max_size) { width *= max_size / height; height = max_size; } } canvas.width = width; canvas.height = height; canvas.getContext('2d').drawImage(image, 0, 0, width, height); var dataUrl = canvas.toDataURL('image/jpeg'); socket.emit("image", {'id': stranger_session, 'image': dataUrl}); $("#msgs").append("

  • "+my_name_li+":
    Random Chat - Instant Chat with Strangers (1)
  • "); $(".myFile").remove(); $("#chatbox").animate({ scrollTop: $('#chatbox')[0].scrollHeight}, 1000); ads_loadet = false; } image.src = e.target.result; } } }; }); var current_title = document.title;socket.on("chat", function(message) { if(stranger_name==false) return; message = $($.parseHTML(encodeHTML(message))).text(); $("#msgs").append("

  • "+ stranger_name +": " + message+ "
  • "); $("#tiping").remove(); $("#say_hi").remove(); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); }); socket.on("system_message", function(message) { $("#msgs").append("

  • System: " + message+ "
  • "); }); socket.on("request_photo", function() { $("#msgs").append("

  • "+ stranger_name +": Requested your photo :
  • "); $("#tiping").remove(); $('#chatbox').prop('scrollTop', $('#chatbox').prop('scrollHeight')); }); socket.on("image", function(source) { // Create an image container var $imageContainer = $('

    ', { style: 'position: relative; display: inline-block;' }); // Create the image element with blur and context menu disabled var $image = $('Random Chat - Instant Chat with Strangers (2)', { src: source, class: 'image-blur', oncontextmenu: 'return false;' }).appendTo($imageContainer); // Modify the warning overlay to be more general var $warningOverlay = $('

    ', { class: 'age-warning', text: 'This image may contain explicit content. Click to view.' }).appendTo($imageContainer); // Click event to toggle blur and warning $imageContainer.on('click', function() { $image.toggleClass('image-blur'); $warningOverlay.toggle(); }); // Assuming the report button has an ID or class that can be targeted var $reportButton = $('

    ', { class: 'report-btn', text: 'Report Image?', click: function() { // Trigger the existing report button functionality $('#report_random').trigger('click'); } }); // Append the image container and report button to the messages list var $listItem = $('

  • ').append( $('').append( $('', { class: 'text-success' }).append( $('', { style: 'color:red', text: stranger_name + ':' }) ) ), '
    ', $imageContainer, $reportButton ).appendTo('#msgs'); // Scroll to the bottom of the chatbox $('#chatbox').animate({ scrollTop: $('#chatbox')[0].scrollHeight }, 2000); // Optionally remove any typing indicator $('#tiping').remove(); // Update any necessary flags or variables, e.g., ads_loaded ads_loadet = false; }); if (window.requestIdleCallback) { requestIdleCallback(function () { Fingerprint2.get(function (components) { var values = components.map(function (component) { return component.value }); murmur = Fingerprint2.x64hash128(values.join(''), 31); }) }) } else { setTimeout(function () { Fingerprint2.get(function (components) { var values = components.map(function (component) { return component.value }); murmur = Fingerprint2.x64hash128(values.join(''), 31); }) }, 500); } });
  • Random Chat - Instant Chat with Strangers (2024)
    Top Articles
    Latest Posts
    Article information

    Author: Manual Maggio

    Last Updated:

    Views: 5542

    Rating: 4.9 / 5 (69 voted)

    Reviews: 84% of readers found this page helpful

    Author information

    Name: Manual Maggio

    Birthday: 1998-01-20

    Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

    Phone: +577037762465

    Job: Product Hospitality Supervisor

    Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

    Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.