Setup
npm
npm install @autobe/agent @autobe/compiler @autobe/interface
npm install @autobe/rpc tgrid
pnpm
pnpm install @autobe/agent @autobe/compiler @autobe/interface
pnpm install @autobe/rpc tgrid
yarn
yarn add @autobe/agent @autobe/compiler @autobe/interface
yarn add @autobe/rpc tgrid
To develop NodeJS WebSocket server of @autobe
, you need to install these packages.
At first, install @autobe/agent
, @autobe/compiler
and @autobe/interface
packages, which are required for chatbot. And then, install @autobe/rpc
and tgrid
packages.
tgrid
is a TypeScript based RPC (Remote Procedure Call) framework supporting WebSocket protocol, and @autobe/rpc
is a wrapper module of @autobe/agent
following the WebSocket RPC.
Development
Main Program
import { AutoBeAgent } from "@autobe/agent";
import { AutoBeCompiler } from "@autobe/compiler";
import { IAutoBeRpcListener, IAutoBeRpcService } from "@autobe/interface";
import { AutoBeRpcService } from "@autobe/rpc";
import OpenAI from "openai";
import { WebSocketServer } from "tgrid";
const server: WebSocketServer<null, IAutoBeRpcService, IAutoBeRpcListener> =
new WebSocketServer();
await server.open(3_001, async (acceptor) => {
const agent: AutoBeAgent<"chatgpt"> = new AutoBeAgent({
model: "chatgpt",
vendor: {
api: new OpenAI({ apiKey: "********" }),
model: "gpt-4.1",
},
compiler: new AutoBeCompiler(),
});
const service: AutoBeRpcService<"chatgpt"> = new AutoBeRpcService({
agent,
listener: acceptor.getDriver(),
});
await acceptor.accept(service);
});
undefined
import { IAutoBeGetFilesOptions } from "../facade/IAutoBeGetFilesOptions";
import { AutoBeHistory } from "../histories/AutoBeHistory";
import { AutoBeUserMessageContent } from "../histories/contents/AutoBeUserMessageContent";
import { IAutoBeTokenUsageJson } from "../json/IAutoBeTokenUsageJson";
/**
* Interface representing the WebSocket RPC service provided by the vibe coding
* server to client applications.
*
* This interface defines the remote procedure call functions that client
* applications can invoke on the vibe coding server through WebSocket
* connections. The service enables interactive conversation-driven development
* where users can communicate requirements through multiple modalities and
* receive comprehensive development artifacts as responses.
*
* In TGrid's RPC paradigm, this service acts as the Provider that the server
* exposes to clients, allowing remote function calls that drive the entire vibe
* coding pipeline from requirements gathering through final implementation.
* Client applications obtain a `Driver<IAutoBeRpcService>` instance to call
* these functions remotely while receiving real-time progress events through
* the {@link IAutoBeRpcListener}.
*
* @author Samchon
*/
export interface IAutoBeRpcService {
/**
* Initiates or continues conversation with the vibe coding AI assistant.
*
* Accepts user input in various formats including simple text, single content
* items, or arrays of multimodal content (text, images, files, audio). The
* conversation drives the entire vibe coding process, with the AI assistant
* analyzing requirements, making decisions about which development phases to
* execute, and coordinating the automated development pipeline.
*
* This function returns the complete history of events generated during the
* conversation turn, allowing clients to access both the conversation flow
* and any development artifacts produced. Real-time progress events are
* delivered separately through the {@link IAutoBeRpcListener} interface for
* responsive user experience.
*
* @param content User input content supporting text strings, single content
* items, or arrays of multimodal content elements
* @returns Promise resolving to array of history records representing all
* events and artifacts generated during this conversation turn
*/
conversate(
content: string | AutoBeUserMessageContent | AutoBeUserMessageContent[],
): Promise<AutoBeHistory[]>;
/**
* Retrieves all generated files from the current development session.
*
* Transforms the complete conversation-driven development process into a
* comprehensive collection of deployable artifacts, including requirements
* documentation, database schemas, API specifications, NestJS implementation
* code, and test suites. The generated files represent a fully functional
* backend application ready for immediate deployment or further
* customization.
*
* The method produces a meticulously organized project structure that
* reflects professional software development standards. Requirements analysis
* documents capture and formalize your conversational input into structured
* technical specifications, providing clear traceability from user intent to
* final implementation. Database artifacts include Prisma schemas with
* precise type definitions, relationships, and constraints, along with
* migration files for proper database initialization and evolution.
*
* The API layer emerges through comprehensive OpenAPI specifications
* documenting every endpoint, request format, response structure, and error
* condition. Generated NestJS controllers, DTOs, and service classes
* implement these specifications with TypeScript's strong typing system
* providing compile-time safety. Quality assurance is embedded throughout
* with complete test suites covering both unit and end-to-end scenarios.
*
* The database configuration specified through the `dbms` option
* fundamentally shapes the entire generated codebase. PostgreSQL
* configuration produces production-ready code with robust connection pooling
* and enterprise-grade optimizations, while SQLite generates lightweight code
* perfect for local development and rapid prototyping without external
* dependencies.
*
* All artifacts maintain perfect consistency across the chosen database
* system, from Prisma configurations and connection strings to Docker compose
* files and environment templates. This deep integration ensures immediate
* deployment compatibility without manual configuration adjustments.
*
* @param options Configuration specifying the target database management
* system and other code generation preferences that influence the structure
* and characteristics of the generated project files
* @returns Promise resolving to key-value pairs mapping logical file paths to
* complete file contents for all generated development artifacts, ready for
* immediate file system operations, build integration, or deployment
* workflows
*/
getFiles(
options?: Partial<IAutoBeGetFilesOptions>,
): Promise<Record<string, string>>;
/**
* Retrieves the complete conversation and development history.
*
* Returns the full chronological record of all events that occurred during
* the vibe coding session including user messages, assistant responses,
* development phase activities, and completion events. This comprehensive
* history enables conversation replay, progress analysis, and understanding
* of the development decision-making process.
*
* The history includes both message-level interactions and development-level
* events, providing complete transparency into how user requirements were
* transformed into working software through the vibe coding pipeline.
*
* @returns Promise resolving to chronologically ordered array of all history
* records from the current session
*/
getHistories(): Promise<AutoBeHistory[]>;
/**
* Retrieves comprehensive token usage statistics for the current session.
*
* Returns detailed breakdown of AI token consumption across all agents and
* processing phases, enabling cost monitoring, performance analysis, and
* optimization of AI resource utilization. The statistics include both
* aggregate totals and component-specific breakdowns with input/output
* categorization and caching analysis.
*
* Token usage data is essential for understanding the computational costs of
* the vibe coding process and optimizing AI efficiency while maintaining
* high-quality output across requirements analysis, database design, API
* specification, testing, and implementation phases.
*
* @returns Promise resolving to comprehensive token usage statistics with
* detailed breakdowns by agent, operation type, and usage category
*/
getTokenUsage(): Promise<IAutoBeTokenUsageJson>;
}
undefined
import {
AutoBeAnalyzeCompleteEvent,
AutoBeAnalyzeReviewEvent,
AutoBeAnalyzeScenarioEvent,
AutoBeAnalyzeStartEvent,
AutoBeAnalyzeWriteEvent,
AutoBeAssistantMessageEvent,
AutoBeInterfaceComplementEvent,
AutoBeInterfaceCompleteEvent,
AutoBeInterfaceEndpointsEvent,
AutoBeInterfaceOperationsEvent,
AutoBeInterfaceOperationsReviewEvent,
AutoBeInterfaceSchemasEvent,
AutoBeInterfaceSchemasReviewEvent,
AutoBeInterfaceStartEvent,
AutoBePrismaCompleteEvent,
AutoBePrismaComponentsEvent,
AutoBePrismaCorrectEvent,
AutoBePrismaInsufficientEvent,
AutoBePrismaReviewEvent,
AutoBePrismaSchemasEvent,
AutoBePrismaStartEvent,
AutoBePrismaValidateEvent,
AutoBeRealizeAuthorizationCorrectEvent,
AutoBeRealizeAuthorizationValidateEvent,
AutoBeRealizeAuthorizationWriteEvent,
AutoBeRealizeCompleteEvent,
AutoBeRealizeCorrectEvent,
AutoBeRealizeStartEvent,
AutoBeRealizeTestCompleteEvent,
AutoBeRealizeTestOperationEvent,
AutoBeRealizeTestResetEvent,
AutoBeRealizeTestStartEvent,
AutoBeRealizeValidateEvent,
AutoBeRealizeWriteEvent,
AutoBeTestCompleteEvent,
AutoBeTestCorrectEvent,
AutoBeTestScenariosEvent,
AutoBeTestStartEvent,
AutoBeTestValidateEvent,
AutoBeTestWriteEvent,
AutoBeUserMessageEvent,
} from "../events";
import { AutoBeInterfaceAuthorizationEvent } from "../events/AutoBeInterfaceAuthorizationEvent";
import { AutoBeInterfaceEndpointsReviewEvent } from "../events/AutoBeInterfaceEndpointsReviewEvent";
import { AutoBeInterfaceGroupsEvent } from "../events/AutoBeInterfaceGroupsEvent";
import { AutoBeRealizeAuthorizationCompleteEvent } from "../events/AutoBeRealizeAuthorizationCompleteEvent";
import { AutoBeRealizeAuthorizationStartEvent } from "../events/AutoBeRealizeAuthorizationStartEvent";
/**
* Interface for WebSocket RPC event listener provided by client applications to
* receive real-time events from the vibe coding server.
*
* This interface defines the event handling contract for client applications
* that connect to the vibe coding WebSocket server. Client applications provide
* an implementation of this interface to receive real-time notifications about
* conversation flow, development progress, and completion events throughout the
* automated development pipeline.
*
* The listener functions enable client applications to provide interactive user
* experiences, display progress indicators, handle development artifacts, and
* respond to the dynamic nature of the vibe coding process. Only
* {@link assistantMessage} and completion events are mandatory, while progress
* events are optional but recommended for enhanced user experience.
*
* @author Samchon
*/
export interface IAutoBeRpcListener {
/* -----------------------------------------------------------
MESSAGES
----------------------------------------------------------- */
/**
* Mandatory handler for assistant message events during conversation flow.
*
* Called when the AI assistant sends messages to the user, providing
* responses, explanations, progress updates, and guidance throughout the vibe
* coding workflow. This is a core communication channel that keeps users
* informed about ongoing activities and system responses.
*/
assistantMessage(event: AutoBeAssistantMessageEvent): Promise<void>;
/**
* Optional handler for user message events during conversation flow.
*
* Called when user messages are processed, allowing client applications to
* track conversation history and provide enhanced user interface features
* such as message confirmation or conversation replay capabilities.
*/
userMessage?(event: AutoBeUserMessageEvent): Promise<void>;
/* -----------------------------------------------------------
ANALYZE PHASE EVENTS
----------------------------------------------------------- */
/**
* Optional handler for requirements analysis start events.
*
* Called when the Analyze agent begins drafting the requirements analysis,
* enabling client applications to show analysis phase initiation and prepare
* progress indicators for the requirements documentation process.
*/
analyzeStart?(event: AutoBeAnalyzeStartEvent): Promise<void>;
/**
* Optional handler for requirements analysis compose events.
*
* Occurs when an agent is called that generates metadata for the analysis,
* such as the table of contents, role, number of pages, and so on.
*/
analyzeScenario?(event: AutoBeAnalyzeScenarioEvent): Promise<void>;
/**
* Optional handler for requirements analysis writing progress events.
*
* Called during the writing phase as analysis documents are being created,
* allowing client applications to display real-time progress and provide
* visibility into the document generation process.
*/
analyzeWrite?(event: AutoBeAnalyzeWriteEvent): Promise<void>;
/**
* Optional handler for requirements analysis review events.
*
* Called during the review and amendment phase, enabling client applications
* to show that requirements are being refined and improved based on feedback
* and additional analysis.
*/
analyzeReview?(event: AutoBeAnalyzeReviewEvent): Promise<void>;
/**
* Mandatory handler for requirements analysis completion events.
*
* Called when the analysis phase completes successfully, providing the
* finalized requirements documentation that serves as the foundation for all
* subsequent development phases. Client applications must handle this event
* to receive the completed analysis artifacts.
*/
analyzeComplete?(event: AutoBeAnalyzeCompleteEvent): Promise<void>;
/* -----------------------------------------------------------
PRISMA PHASE EVENTS
----------------------------------------------------------- */
/**
* Optional handler for database design start events.
*
* Called when the Prisma agent begins database schema design, enabling client
* applications to indicate the start of data architecture development and
* prepare progress tracking for the database design phase.
*/
prismaStart?(event: AutoBePrismaStartEvent): Promise<void>;
/**
* Optional handler for database component organization events.
*
* Called when tables are organized into categorized groups by business
* domain, allowing client applications to display the structural planning of
* the database architecture and show progress scope.
*/
prismaComponents?(event: AutoBePrismaComponentsEvent): Promise<void>;
/**
* Optional handler for database schema creation progress events.
*
* Called each time a domain-specific schema file is completed, enabling
* client applications to track incremental progress and show which business
* areas have been fully designed.
*/
prismaSchemas?(event: AutoBePrismaSchemasEvent): Promise<void>;
/**
* Optional handler for database schema insufficient model creation events.
*
* Called when the AI function calling process creates fewer models than
* expected for a specific business domain during database schema generation.
* This event indicates that the schema creation was incomplete and may
* require additional iterations or corrective actions to generate the missing
* models.
*
* Client applications can use this event to inform users about partial schema
* completion, display which models were successfully created versus which are
* still missing, and potentially trigger retry mechanisms or manual
* intervention workflows to complete the database design.
*
* The event provides detailed information about completed models and missing
* model names, enabling targeted recovery strategies to address the
* insufficient generation and ensure comprehensive database schema coverage.
*/
prismaInsufficient?(event: AutoBePrismaInsufficientEvent): Promise<void>;
/**
* Optional handler for database schema review events.
*
* Called when the Prisma agent reviews and validates schema modifications,
* enabling client applications to show that the database design is being
* thoroughly evaluated against best practices and business requirements.
*
* Client applications can use this event to display the review findings,
* highlight any necessary modifications, and confirm that the schema adheres
* to normalization principles, relationship integrity, and performance
* optimization.
*
* The review process ensures that the database design is robust, maintains
* data integrity, and aligns with the overall project goals and
* requirements.
*/
prismaReview?(event: AutoBePrismaReviewEvent): Promise<void>;
/**
* Optional handler for database schema validation events.
*
* Called when validation failures occur during schema compilation, allowing
* client applications to inform users about quality assurance processes and
* potential correction activities.
*/
prismaValidate?(event: AutoBePrismaValidateEvent): Promise<void>;
/**
* Optional handler for database schema correction events.
*
* Called when the AI self-correction process addresses validation failures,
* enabling client applications to show that issues are being resolved
* automatically through the feedback loop mechanism.
*/
prismaCorrect?(event: AutoBePrismaCorrectEvent): Promise<void>;
/**
* Mandatory handler for database design completion events.
*
* Called when the Prisma phase completes successfully, providing the
* validated database schemas and compilation results. Client applications
* must handle this event to receive the completed database artifacts.
*/
prismaComplete?(event: AutoBePrismaCompleteEvent): Promise<void>;
/* -----------------------------------------------------------
INTERFACE PHASE EVENTS
----------------------------------------------------------- */
/**
* Optional handler for API design start events.
*
* Called when the Interface agent begins RESTful API specification design,
* enabling client applications to indicate the start of API development and
* prepare progress tracking for the interface design phase.
*/
interfaceStart?(event: AutoBeInterfaceStartEvent): Promise<void>;
/**
* Optional handler for API interface group creation events.
*
* Called when the Interface agent generates groups of API endpoints based on
* the organized database schemas, enabling client applications to show the
* initial scope of API surface area being designed and track progress in the
* interface design phase.
*
* @param event The event containing the created interface groups.
*/
interfaceGroups?(event: AutoBeInterfaceGroupsEvent): Promise<void>;
/**
* Optional handler for API endpoint creation events.
*
* Called when the complete list of API endpoints is established, allowing
* client applications to show the API surface area scope and architectural
* foundation being built.
*/
interfaceEndpoints?(event: AutoBeInterfaceEndpointsEvent): Promise<void>;
/**
* Optional handler for API endpoint review events.
*
* Called when the Interface agent reviews API endpoints, enabling client
* applications to show the review process and any identified issues.
*/
interfaceEndpointsReview?(
event: AutoBeInterfaceEndpointsReviewEvent,
): Promise<void>;
/**
* Optional handler for API operation definition progress events.
*
* Called as detailed operation specifications are created for each endpoint,
* enabling client applications to track progress and show how API
* functionality is being systematically developed.
*/
interfaceOperations?(event: AutoBeInterfaceOperationsEvent): Promise<void>;
/**
* Optional handler for API operation review events.
*
* Called when the Interface agent reviews API operations, enabling client
* applications to show the review process and any identified issues.
*/
interfaceOperationsReview?(
event: AutoBeInterfaceOperationsReviewEvent,
): Promise<void>;
/**
* Optional handler for API authorization operation definition progress
* events.
*
* Called as detailed authorization operation specifications are created for
* each endpoint, enabling client applications to track progress and show how
* API authorization is being systematically developed.
*/
interfaceAuthorization?(
event: AutoBeInterfaceAuthorizationEvent,
): Promise<void>;
/**
* Optional handler for API component schema creation events.
*
* Called when reusable schema components are being defined, allowing client
* applications to show progress in type definition and data structure
* development for the API specification.
*/
interfaceSchemas?(event: AutoBeInterfaceSchemasEvent): Promise<void>;
/**
* Optional handler for API schema review and enhancement events.
*
* Called when the Interface agent reviews and improves the generated OpenAPI
* schemas, enabling client applications to show the quality assurance process
* where schemas are validated for completeness, security compliance, and type
* safety before being integrated into the final API specification.
*/
interfaceSchemasReview?(
event: AutoBeInterfaceSchemasReviewEvent,
): Promise<void>;
/**
* Optional handler for API schema complement events.
*
* Called when missing schemas are identified and added to complete the
* specification, enabling client applications to show that gaps are being
* filled to ensure comprehensive API coverage.
*/
interfaceComplement?(event: AutoBeInterfaceComplementEvent): Promise<void>;
/**
* Mandatory handler for API design completion events.
*
* Called when the Interface phase completes successfully, providing the
* complete OpenAPI specification and generated NestJS application files.
* Client applications must handle this event to receive the completed API
* artifacts.
*/
interfaceComplete?(event: AutoBeInterfaceCompleteEvent): Promise<void>;
/* -----------------------------------------------------------
TEST PHASE EVENTS
----------------------------------------------------------- */
/**
* Optional handler for test suite generation start events.
*
* Called when the Test agent begins creating e2e test scenarios, enabling
* client applications to indicate the start of test development and prepare
* progress tracking for comprehensive validation coverage.
*/
testStart?(event: AutoBeTestStartEvent): Promise<void>;
/**
* Optional handler for test scenario planning events.
*
* Called when test scenarios are being planned and organized, allowing client
* applications to show the scope of validation coverage being designed for
* the application.
*/
testScenarios?(event: AutoBeTestScenariosEvent): Promise<void>;
/**
* Optional handler for test code generation progress events.
*
* Called as individual test files are created, enabling client applications
* to track incremental progress and show which API endpoints are being
* validated through comprehensive test scenarios.
*/
testWrite?(event: AutoBeTestWriteEvent): Promise<void>;
/**
* Optional handler for test code validation events.
*
* Called when test code undergoes TypeScript compilation validation, allowing
* client applications to show quality assurance processes and potential
* correction activities for test code.
*/
testValidate?(event: AutoBeTestValidateEvent): Promise<void>;
/**
* Optional handler for test code correction events.
*
* Called when the AI self-correction process addresses compilation failures
* in test code, enabling client applications to show that issues are being
* resolved automatically through iterative improvement.
*/
testCorrect?(event: AutoBeTestCorrectEvent): Promise<void>;
/**
* Mandatory handler for test suite completion events.
*
* Called when the Test phase completes successfully, providing the complete
* test suite with comprehensive validation coverage. Client applications must
* handle this event to receive the completed test artifacts.
*/
testComplete?(event: AutoBeTestCompleteEvent): Promise<void>;
/* -----------------------------------------------------------
REALIZE PHASE EVENTS
----------------------------------------------------------- */
/**
* Optional handler for implementation start events.
*
* Called when the Realize agent begins implementing business logic and
* service layer code, enabling client applications to indicate the start of
* the final implementation phase.
*/
realizeStart?(event: AutoBeRealizeStartEvent): Promise<void>;
/**
* Optional handler for authorization implementation start events.
*
* Called when the Realize agent begins implementing authentication and
* authorization components, including providers, payloads, and decorators for
* role-based access control.
*/
realizeAuthorizationStart?(
event: AutoBeRealizeAuthorizationStartEvent,
): Promise<void>;
/**
* Optional handler for authorization implementation progress events.
*
* Called when the Realize agent generates authorization components
* (providers, payloads, decorators) for each user role, enabling client
* applications to track the progress of authorization system implementation.
*/
realizeAuthorizationWrite?(
event: AutoBeRealizeAuthorizationWriteEvent,
): Promise<void>;
/**
* Optional handler for authorization validation events.
*
* Called when the Realize agent validates the generated authorization
* components (providers, payloads, decorators), enabling client applications
* to show quality assurance processes and potential correction activities for
* the authentication and authorization system.
*/
realizeAuthorizationValidate?(
event: AutoBeRealizeAuthorizationValidateEvent,
): Promise<void>;
/**
* Optional handler for authorization correction events.
*
* Called when the Realize agent corrects compilation failures in the
* generated authorization implementation code (providers, payloads,
* decorators), enabling client applications to show that issues are being
* resolved automatically through iterative improvement.
*/
realizeAuthorizationCorrect?(
event: AutoBeRealizeAuthorizationCorrectEvent,
): Promise<void>;
/**
* Optional handler for authorization implementation completion events.
*
* Called when the Realize agent completes the implementation of all
* authorization components, signaling that the authentication and
* authorization system is fully implemented and ready for use.
*/
realizeAuthorizationComplete?(
event: AutoBeRealizeAuthorizationCompleteEvent,
): Promise<void>;
/**
* Optional handler for implementation progress events.
*
* Called as individual implementation files are created, enabling client
* applications to track incremental progress and show how the complete
* application functionality is being assembled.
*/
realizeWrite?(event: AutoBeRealizeWriteEvent): Promise<void>;
/**
* Optional handler for implementation correction events.
*
* Called when the AI self-correction process addresses compilation or logic
* errors in implementation code, allowing client applications to reflect that
* backend logic is being automatically improved through iterative fixes.
*
* This enables real-time visibility into how faulty implementation files are
* revised and finalized by the Realize agent to meet project standards.
*/
realizeCorrect?(event: AutoBeRealizeCorrectEvent): Promise<void>;
/**
* Optional handler for implementation validation events.
*
* Called when implementation code undergoes compilation validation, allowing
* client applications to show quality assurance processes and potential
* correction activities for the final implementation.
*/
realizeValidate?(event: AutoBeRealizeValidateEvent): Promise<void>;
/**
* Optional handler for implementation completion events.
*
* Called when the Realize phase completes successfully, providing the
* complete working application implementation. Client applications must
* handle this event to receive the final implementation artifacts that
* represent the culmination of the entire vibe coding pipeline.
*/
realizeComplete?(event: AutoBeRealizeCompleteEvent): Promise<void>;
/**
* Optional handler for implementation test start events.
*
* Called when the Realize agent begins running the test suite to validate the
* generated implementation, enabling client applications to show that
* comprehensive testing is beginning to ensure application quality and
* functionality.
*/
realizeTestStart?(event: AutoBeRealizeTestStartEvent): Promise<void>;
/**
* Optional handler for implementation test reset events.
*
* Called when the test environment is reset between test runs, allowing
* client applications to show that clean testing conditions are being
* established to ensure reliable and isolated test execution.
*/
realizeTestReset?(event: AutoBeRealizeTestResetEvent): Promise<void>;
/**
* Optional handler for implementation test operation events.
*
* Called during individual test operation execution, enabling client
* applications to provide detailed progress tracking and show which specific
* API endpoints and business logic components are being validated through the
* comprehensive test suite.
*/
realizeTestOperation?(event: AutoBeRealizeTestOperationEvent): Promise<void>;
/**
* Optional handler for implementation test completion events.
*
* Called when the complete test suite execution finishes, providing test
* results and validation outcomes. Client applications can use this event to
* show final quality assurance results and confirm that the generated
* application meets all specified requirements and passes comprehensive
* validation.
*/
realizeTestComplete?(event: AutoBeRealizeTestCompleteEvent): Promise<void>;
}
You can develop WebSocket server application like above.
At first, create an WebSocketServer
instance with IAutoBeRpcService
and IAutoBeRpcListener
type specifiactions, and open the server with a port number and a callback function that is called whenever a client is connected.
And in the callback function, create an AutoBeAgent
instance and wrap it into a new AutoBeRpcService
instance. And then accept the client connection by calling the WebSocketAcceptor.accept()
function with the AutoBeRpcService
instance.
When youβve completed the acceptance, everything is completed. When client calls the IAutoBeRpcService.conversate()
function remotely, server will response to the client by calling the IAutoBeRpcListener
functions remotely too.