Package Torello.Browser
Class WebSocketSender
- java.lang.Object
-
- Torello.Browser.WebSocketSender
-
public class WebSocketSender extends java.lang.Object
This class implements a connection to a Web-Browser using the Remote Debug Protocol over Web-Sockets.Browser Remote Debug Protocol Connection Class
Java is capable of communicating with either a Headless instance of Google Chrome - or any browser that implements the Remote Debuggin Protocol. It is not mandatory to run the browser in headless mode, but it is more common.
Hi-Lited Source-Code:This File's Source Code:
- View Here: Torello/Browser/WebSocketSender.java
- Open New Browser-Tab: Torello/Browser/WebSocketSender.java
File Size: 6,145 Bytes Line Count: 160 '\n' Characters Found
Response Handler:
- View Here: WSAdapter.java
- Open New Browser-Tab: WSAdapter.java
File Size: 10,571 Bytes Line Count: 275 '\n' Characters Found
-
-
Constructor Summary
Constructors Constructor WebSocketSender(String url, ConnRecord connRec)
-
Method Summary
Close the Browser WebSocket Connection Modifier and Type Method voiddisconnect()
-
-
-
Constructor Detail
-
WebSocketSender
public WebSocketSender(java.lang.String url, ConnRecord connRec) throws java.io.IOException, WebSocketException
Opens a Connection to a Web Browser using a Web-Socket. This class will now be ready to acceptsend(Script, Promise)messages to the browser.- Parameters:
url- This is aURLthat is generated by the browser, and has a baseURLthat is just127.0.0.1, followed by a port number. There will also be an identifier-code.- Throws:
java.io.IOException- Throws if there are problems connecting the socket.WebSocketException- Throws if the NeoVisionaries Package encounters a problem building the socket connection.
-
-
Method Detail
-
disconnect
public void disconnect()
Closes theWebSocketconnection to the Browser's Remote Debug Port.- Code:
- Exact Method Body:
webSocket.disconnect();
-
-