Coder Social home page Coder Social logo

voitgxd / chatbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rong77/chatbox

0.0 2.0 0.0 705 KB

A simple chatbox app adapted from Socket.io's chat example, it allows file transfer and image/video can be rendered directly.

JavaScript 82.15% HTML 11.65% CSS 6.20%

chatbox's Introduction

English version

Chatbox

A simple chatbox app adapted from Socket.io's chat room demo, it allows file transfer and features a control panel for admin to use.

How to use

$ cd chatbox
$ npm install
$ node index.js

And point your browser to http://localhost:4321 to go to chatbox page. Admin page is at http://localhost:4321/admin.html, default token is '12345'. Edit the token in index.js and put the same value in token field in Admin page then you are good to go.

To embed this chatbox into a web page, just copy paste the content in public/index.html to the page you want to have chatbox, then change all included css file and JavaScript file path correctly. This app works great with light box library, I personally recommend using fancybox.

Future plan

  • Improve chat history feature, currently only storing latest 20 messages
  • Improve file transfer support, currently file larger than 10MB may fail to transfer due to timeout, and client side may freeze once receive large file.

Demo

You can see how it looks at my own blog here: http://lifeislikeaboat.com. The chatbox is minimized at left bottom by default.

Screenshot

screenshot

screenshot


中文版

聊天盒

该聊天盒修改自Socket.io的聊天室示例, 可以满足小型文件的传输,并且有控制台功能,管理员既可对全体游客亦可对特定游客进行操作。

如何使用

$ cd chatbox
$ npm install
$ node index.js

在本地安装则直接访问http://localhost:4321即可进入聊天盒。 控制台的访问地址为http://localhost:4321/admin.html, 默认的密码为“12345”。 您可以通过修改index.js文件里的Token值来改掉默认密码。

如果想把聊天盒嵌入网站中,只要将public/index.html文件的内容复制粘贴到想要显示聊天盒的网页里,public/index.html中所有包含的css和JavaScript文件地址需要修改正确。 推荐配合fancybox插件使用来放大聊天盒里的图片。

下一步

  • 改进聊天记录功能,目前只能存储最近的20条。
  • 改进文件传输功能,目前对于稍大文件(大于10MB)的支持不好。

示例

您可以在我的博客试用该聊天盒,默认最小化于左下角: http://lifeislikeaboat.com

截图

screenshot

screenshot

chatbox's People

Contributors

arch1tect avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.